aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes forcing a JToolBar to fill the line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "forcing a JToolBar to fill the line" Watch "forcing a JToolBar to fill the line" New topic
Author

forcing a JToolBar to fill the line

Gidi Morris
Greenhorn

Joined: Aug 29, 2001
Posts: 3
How do I force a JToolBar to strech from begining to end so that if I have 2 toolbars I don't end up with a situation where they are side to side, but one above the other?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I assume you are using a borderlayout of some sort.
I don't know how to do it using a border layout because you have to use some sort of buffer components to put between to make them do what you want.
I always set my Layout to null and setBounds on all my components. That way they are exactly where I want them. Or course, that is only if you don't allow the user to resize the frames.

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Gidi Morris
Greenhorn

Joined: Aug 29, 2001
Posts: 3
I need to allow them to resize.
You see the problem is that I can't figure out how to have the Menu in side its own toolbar so its floating but also have a seperate toolbar with buttons onit, but have them one above the other, and not side to side.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: forcing a JToolBar to fill the line