?
Solved

JtoolBar and BasicToolBarUI - JToolBar will not stay on top!

Posted on 2006-05-25
11
Medium Priority
?
487 Views
Last Modified: 2008-02-01
Hi

I have a JToolBar that I am using in conjunction with a BasicToolBarUI that allows me to start the toolbar in a floating state - Great! The problem now is the floating toolbar does not stay on top of all the windows; in fact, it goes behind all of them including the JFrame.

Is there a way to keep the floating toolbar using BasicToolBarUI on top of all windows?

Thanks,

waffe
0
Comment
Question by:waffe
10 Comments
 
LVL 2

Expert Comment

by:appxpete
ID: 16764781
This Experts Exchange posting seems to answer this question.

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21460045.html
0
 

Author Comment

by:waffe
ID: 16766353
I've been working with this link but nothing seems to pan out. My script is different than the example in the link - thanks but I think my problem is slightly different.

Why does the toolbar go behind any window when you use it in conjunction with BasicToolBarUI? / Is there a different way to start the toolbar in a floating state and still have it hold its top window focus?

waffe
0
 
LVL 14

Expert Comment

by:hoomanv
ID: 16766605
a bit googling made me believe that this functionality is not yet available in pure java. some people had tried it thru JNI but no code were available. therefor the solution is somthing other than JToolBar, say for example a JDialog. I mean you should make the toolbar UN floatable. and whenever the user tries to float it, you have to take control of everything, poping up a JDilaog (which is always on top) and surely hide/remove the toolbar ...
sorry, I dont have any idea on how you can implement it
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:waffe
ID: 16773999
I have also been working two JInternalFrames and a JDesktopPane. I put the toolbar in one JInternalFrames and my other content in the other JInternalFrames and I add them both to a   JDesktopPane - Great! Now how do I force a JInternalFrame to always stay on top of another?
0
 

Author Comment

by:waffe
ID: 16774382
Thanks,

It kind of works, the JInternalFrame that holds the toolbar is on top until the main content (not the frame) of the other JInternalFrame is moved over the toolBar JInternalFrame.

I believe my problem is because the other JInternalFrame has an applet from a java program call Processing. I had a similar problem with a JMenuBar here that was resolved. http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21851443.html 
Can the same methodology be applied to a JInternalFrame?

Thanks,

waffe
0
 

Author Comment

by:waffe
ID: 16777707
To add....

The JInternalFrame that has the processing applet in it is always above all components except the JMenuBar with this command added to it - JPopupMenu.setDefaultLightWeightPopupEnabled(false);

waffe
0
 

Author Comment

by:waffe
ID: 16781312
Found the problem - I think - The processing applet (PApplet) extends Applet which is an AWT or heavyweight component. Swing components are considered lightweight and there is a layering problem that comes into play when using these two types of components.

Looks like I may have to go to AWT instead of swing for my GUI - BOOOOOOOOOOOO!!!!!!!!!

Thanks for you suggestions.

4dplane
0
 

Author Comment

by:waffe
ID: 16781317
Here is a link that describes heavy and light weight components.
http://java.sun.com/products/jfc/tsc/articles/mixing/
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 16838958
Points (350) refunded and question closed.

Netminder
Site Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

864 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