Sorry for my bad english. Try the following:
setUndecorated(true); AWTUtilities.setWindowOpaque(this, false); getRootPane().putClientProperty("apple.awt.draggableWindowBackground", Boolean.FALSE);
By default, the setWindowOpaque function sets this client property to true. But this client property makes every component in your window draggable.
Now you need to make the drag code yourself.
source share