boolean focusable = getFocusableWindowState();
if (focusable) {
SizeGrip sg = new SizeGrip();
sg.applyComponentOrientation(sg.getComponentOrientation()); // Workaround
panel.add(sg, BorderLayout.LINE_END);
MouseInputAdapter adapter = new MouseInputAdapter() {
private Point lastPoint;
public void mouseDragged(MouseEvent e) {
Point p = e.getPoint();
SwingUtilities.convertPointToScreen(p, panel);
if (lastPoint==null) {