java - JTable not able to add scroll bars -
java - JTable not able to add scroll bars -
i having jtable has records can't fit have decided add together scrollbars. however, scroll bar isn't appearing. doing wrong?
new jscrollpane(table, jscrollpane.vertical_scrollbar_always, jscrollpane.horizontal_scrollbar_always); table.setautoresizemode(jtable.auto_resize_off); table.setbounds(10, 73, 850, 850);
according answers have now:
jscrollpane panel = new jscrollpane(table, jscrollpane.vertical_scrollbar_always, jscrollpane.horizontal_scrollbar_always); table.setautoresizemode(jtable.auto_resize_off); panel.setbounds(10, 73, 850, 850); contentpane.add(table);
now table isn't shown.
contentpane.add(table);
you removing table scrollpane.
you must add together scroll pane frame. code should be:
contentpane.add(panel);
java swing jtable jscrollpane null-layout-manager
Comments
Post a Comment