Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forcing a JToolBar to fill the line

 
Gidi Morris
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gidi Morris
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic