aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Can't control BoxLayout when adding JTableHeader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Can Watch "Can New topic
Author

Can't control BoxLayout when adding JTableHeader

Jim Hoglund
Ranch Hand

Joined: Jan 09, 2008
Posts: 525
Good morning to all. I'm having BoxLayout trouble. In this code the header demands
extra space on the right and the table body demands extra space on the left. But I need
the box to be as narrow as possible. (I'm adding a border to see the box size.) I've been
avoiding using a JScrollPane. Any ideas?

Jim ...


BEE MBA PMP SCJP-6
Jim Hoglund
Ranch Hand

Joined: Jan 09, 2008
Posts: 525
Careful attention to component alignment and sizes eventually solved the problem. Adding
borders to each container, and printing MIN, PREFERRED, MAX sizes to the console helped
to see that was going on. The Box class is very handy and seems easy to work with. I can
elaborate further on where I ended up, if anyone is interested. Also, I wonder what others
think about the Group layout manager.

Jim...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't control BoxLayout when adding JTableHeader
 
Similar Threads
JTextArea
Box.createGlue() creates nothing
Colorizing a Box
getBounds()/getWidth() returns 0
Problem with GridBagLayout and a vertical layout of JPanels