java - Set JFrame size after JTable size -
i want size of frame adjust number of cells in table. setting size integers isn't flexible enough, since can't see cells if table's size exceeds frame's size.
i've tried this:
table.setpreferredsize(new dimension(table.width, table.height));
it doesn't work desired, since have manually resize frame mouse see cells. there method this?
don't alter size of jtable
using setpreferredsize
, prevent table been able show rows or columns extend beyond range of size set.
jtable
should embedded within jscrollpane
, jscrollpane
added frame...
add(new jscrollpane(table));
this allow table exceed frames viewable bounds, allow scroll , see them
see how utilize tables , how utilize scroll panes more details
java user-interface resize jtable jframe
No comments:
Post a Comment