Turning off a floating JToolBar

Posted on 2007-07-19
Medium Priority
Last Modified: 2012-06-22
I am developing an app that has several tabs in a JTabbedPane.  When a tab is selected I want a tab specific toolbar to be added to a panel 'toolPanel'  and then removed when the tab is deselected.

I have implemented a tablistener that adds and removes the toolbars and this works fine unless the user has dragged the toolbar off the toolPanel.  In that case the toolbar is still removed but the title of its JToolBar window is still there and can only be got rid of by clicking the close-window control.  I can make the toolbar not floatable but I dont want to.

This code is run when a tab is activated

this code is run when the tab is deactivated

Is there a better way of doing this and how do I get rid of the floating toolbars frame ?

I am using JSE6.

Question by:luckybonanza
LVL 92

Expert Comment

ID: 19528567

LVL 23

Accepted Solution

Siva Prasanna Kumar earned 750 total points
ID: 19594230
If the toolbar is tab specific i think its better to disable the floating of the toolbar

      toolbar .setFloatable(false) ;

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month16 days, 20 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question