my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes Problem with JToolBar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with JToolBar" Watch "Problem with JToolBar" New topic

Problem with JToolBar

Igor Stojanovic
Ranch Hand

Joined: Feb 18, 2005
Posts: 58

I writing my text editor in Java, something very similar to Notepad but with more funcionality...i would like to have floatable toolbars which behave same as in other aplications like in Word,so far i have created 3 toolbars and the problem is when user selects and drags out 1 of them for example 2. one in middle last 2 toolbars move to the left end, and now when user closes opened (2. toolbar) he gets back under menu bar but on last postion...I am not sure if I explained it right but I will try to "draw it" down:

---------------------MENU BAR------------------------

now i take out (drag it) second toolbar

and it looks like this now

---------------------MENU BAR------------------------

-this one somewhere on screen

-after I close my second tool bar it looks like this

---------------------MENU BAR------------------------

Problem is that now 3. toolbar is infront of 2. which has no sence

How can I fix this problem and keep toolbars floatable at same time?

Thx in advance

Igor Stojanovic
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
In the JToolBar api discussion section, second paragraph there is a recommendation for obtaining proper docking behavior. Try this
Igor Stojanovic
Ranch Hand

Joined: Feb 18, 2005
Posts: 58
Thx a lot !

I solved my problem .
I agree. Here's the link:
subject: Problem with JToolBar