Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2006

Tip: Looking for answers? Try searching our database.

Floating toolbar is not disappearing

Thread view: 
the Sun - 14 Mar 2006 12:08 GMT
Hi all,

I have a JToolbar on a panel, which is floatable
If I make the toolbar floating in its own window and make the panel
setVisible( false), the toolbar is still visible

I want the toolbar also to disappear
How can I solve this issue?

Thanks in advance
-
Satish
IchBin - 14 Mar 2006 16:55 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
> -
> Satish

What does you code look like?

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Vova Reznik - 14 Mar 2006 17:01 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
> -
> Satish

Simply override setVisible for your panel:

public void setVisible(boolean visible){
  toolbar.setVisible(visible);
  super.setVisible(visible);
}
the Sun - 16 Mar 2006 09:51 GMT
I think I was not clear, lemme explain

JFrame frame = new JFrame();
JPanel panel = new JPanel(new BorderLayout());

JToolBar toolbar = new JToolBar();
toolbar.setFloatable( true);
toolbar.add( new JButton("Open"));
toolbar.add( new JButton("New"));

panel.add( toolbar, BorderLayout.NORTH);
panel.add(...);

frame.add( panel, BorderLayout.NORTH);

frame.setVisible( true);

Then, in a action handler,

panel.setVisible( false);

When the frame is visible, click and drag the toolbar so that the
toolbar appears in its own window.
This hides only the panel, button the toolbar remains in its own
window.

toolbar.setVisible( false); hides only the buttons on toolbar, but the
window( which appears when its dragged out of its place) is still
visible.

I want to show a different panel, when a particular event happens, for
which I have to hide the current toolbar. But it is not happening when
I drag the toolbar and make it appear(float) in its own window

Hope I am clear now


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.