void (MouseEvent e) { super.processMouseMotionEvent(e); if (!myResizeEnabled) return; if (MouseEvent.MOUSE_DRAGGED == e.getID() && myDragging) { myPoint = SwingUtilities.convertPoint(this, e.getPoint(), mySplitter.asComponent()); float proportion; float firstMinProportion = mySplitter.getMinProportion(true); float secondMinProportion = mySplitter.getMinProportion(false); Component comp = mySplitter.asComponent(); float thickness = isVertical() ? comp.getHeight() : comp.getWidth(); if (thickness == 0) thickness = 1f; float position = isVertical() ? myPoint.y : myPoint.x; float ratio = position / thickness; proportion = MathUtil.clamp(Math.min(Math.max(firstMinProportion, ratio), 1 - secondMinProportion), 0f, 1f); mySplitter.setProportion(proportion); e.consume(); } }