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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -