File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 15299
    
    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
 
Similar Threads
Modify JToolBar buttons and actions
a few questions about JToolBar
Separator in JToolBar
How To increase JToolBar, make JTabbedPanes scrollable
Update GUI In Realtime