posted 9 years ago
I would like to know if anyone knows of a better, less hackish way to do this.
- doesn't exist for JTable with reasonable numbers of rows,
- but there is one issue that can messing up this good idea, horizontal JScrollBar
to cuts JTables Dimension (setAutoResizeMode(AUTO_RESIZE_OFF), by calculating
with (without JScrollBar) you would need to put there empty space for JScrollBar
(by leaving ...if this is nice or not)
- because this idea is just for reasonable numbers of rows (JFrame.pack()), I'd be ends
with, by using JTable.setPreferredScrollableViewportSize( new Dimension( int, int ) );,
where is super.getPreferredSize().width and height is limited (to reasonable) number
of rows