Forums Register Login

Can't control BoxLayout when adding JTableHeader

+Pie Number of slices to send: Send
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 ...
+Pie Number of slices to send: Send
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...
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1396 times.
Similar Threads
Colorizing a Box
JTextArea
Box.createGlue() creates nothing
Problem with GridBagLayout and a vertical layout of JPanels
getBounds()/getWidth() returns 0
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:54:41.