How do I make my Java 7 OSX App draggable on toolbar only ?

Paul Taylor paul_t100 at fastmail.fm
Thu Oct 31 10:30:36 PDT 2013


Things were working okay with Java 6 ( and some custom libs) but now by 
default a Java 7 application is only movable on Mac if you click near 
the top of the window (like on Windows), however if I set

toolbar.getRootPane().putClientProperty("apple.awt.draggableWindowBackground") 


I can then move the window by dragging on the toolbar. Unfortunately 
because this property is applied to the rootpane, and then is just one 
rootpane for the frame that the whole applications is a part of the 
window moves where-ever I drag on it, I only want to be able to drag on 
it in the toolbar.

The main part of my application is a JTable and I really don't want the 
window to be moved when I dragclick here because it causes lots of 
problems such as I can now no longer reorder by table columns by 
dragging the table headers because that just moves the whole window. How 
can I limit movement to either:

1. Only the JToolbar
2. Everywhere except the Jtable

whichever is easiest.

thanks Paul


More information about the macosx-port-dev mailing list