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

2013-11-04 Thread Paul Taylor

On 31/10/2013 17:30, Paul Taylor wrote:
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

Nevermind I found a solution, I used UnifiedToolbar from 
thehttp://code.google.com/p/macwidgets/ project with Java 6. Since 
moving to Java 7 and no longer using UnifiedToolbar I couldn't see a 
solution but delving into their code simply using WindowsDragger class 
works perfectly well


i.e.

new WindowsDragger(frame, toolbar);
new WindowsDragger(frame, statusbar)

In contrast the apple.awt.draggableWindowBackground option is only 
really useful if happy for the whole frame to be draggable.


Paul




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

2013-11-04 Thread Paul Taylor

On 04/11/2013 09:37, Hendrik Schreiber wrote:

On Nov 4, 2013, at 10:05 AM, Paul Taylor wrote:

Nevermind I found a solution, I used UnifiedToolbar from 
thehttp://code.google.com/p/macwidgets/ project with Java 6. Since moving to 
Java 7 and no longer using UnifiedToolbar I couldn't see a solution but delving 
into their code simply using WindowsDragger class works perfectly well

i.e.

new WindowsDragger(frame, toolbar);
new WindowsDragger(frame, statusbar)

In contrast the apple.awt.draggableWindowBackground option is only really 
useful if happy for the whole frame to be draggable.

In other words: it's not useful.
But it would be great, if there was something that worked the way Paul used it 
originally. I.e. a property that can be set on a panel that makes it so that 
you can drag the window by dragging a panel/container.

-hendrik

Well it can be useful I use

apple.awt.draggableWindowBackground

in my SongKong app, and there is it is fine, but yes the option could really be 
improved on.

Paul