JToolbar on a JDesktopPane

hello,

is there a way to put a floatable toolbar on a desktoppane?

I put it now in a seperate internal frame, but when you drag the toolbar you get the odd result of a toolbar on the desktoppane and an empty internal frame.

Where I'm searching for is the toolbar you get after dragging him out of his internal frame.

TIA

[352 byte] By [jochima] at [2007-10-2 6:50:05]
# 1

> is there a way to put a floatable toolbar on a

> desktoppane?

Well, you can try it and let us know the result. At least it seems to work fine for me.

> I put it now in a seperate internal frame, but when

> you drag the toolbar you get the odd result of a

> toolbar on the desktoppane and an empty internal

> frame.

Isn't this what you want: a toolbar on the desktop pane?

ajneoa at 2007-7-16 13:59:02 > top of Java-index,Desktop,Core GUI APIs...
# 2

>Well, you can try it and let us know the result. At least it seems to work fine for me.

posting it here is already a result of trying it, and not finding a satisfying result

> Isn't this what you want: a toolbar on the desktop pane?

Yes, but not at the cost of an empty JInternalFrame that's on the desktop. So I"m searching for the clean solution of a toolbar immediately on the desktop, and not packed in an internalframe

jochima at 2007-7-16 13:59:02 > top of Java-index,Desktop,Core GUI APIs...
# 3

> So I"m searching for the clean

> solution of a toolbar immediately on the desktop, and

> not packed in an internalframe

Now I see your requirements clearly.

My suggestion is to use a JFrame and place your toolbar at the North and the desktop pane at the Center, using the default Border Layout of JFrame. The JDesktopPane uses an Absolute Layout and is meant for holding JInternalFrame. On the other hand, the toolbar needs to be in a container that uses Border Layout so its drag behavior can function correctly.

ajneoa at 2007-7-16 13:59:02 > top of Java-index,Desktop,Core GUI APIs...
# 4
if I place the toolbar on the north an the desktop on the center, won't the toolbar be outside the actual desktop (like an internet explorer look)?What I want to get is kind of a photoshop toolbar look.
jochima at 2007-7-16 13:59:02 > top of Java-index,Desktop,Core GUI APIs...
# 5

you can put any component you want in a desktop pane on any layer you want. It's just a glorified JLayeredPane. JInternalFrames only get you window management for the desktop pane. I don't see why putting a toolbar inside a JInternalFrame wouldn't work, though.Otherwise put the toolbar in the frame and add mouse listeners or something to handle making in moveable.

bsampieria at 2007-7-16 13:59:02 > top of Java-index,Desktop,Core GUI APIs...