sclass JDraggableBoxDemo is Swingable { cachedVisualize { var parent = jpanelWithoutLayoutManager(); var box = jMinSize(400, 300, jcenteredlabel("Drag or resize me!")); setBorder(box, BorderFactory.createLineBorder(Color.green, 10); onMouseDown(box, event -> { if (!mouseEventIsInBorder(event)) { printVars("ComponentDragger start"); new ComponentDragger(box, event).debug(true).start(); } }); new ComponentResizeDragger(box, box).debug(true); setBounds(box, 50, 50, 400, 300); addToContainer(parent, box); ret parent; } }