Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fill the height of JScrollPane with empty JTable Rows?

Tags:

java

swing

jtable

I am putting a JTable in a JScrollPane, but the table only contain several rows, which makes the rest of the space in the pane just empty.

Is there any way I can do to make the JTable fill the entire pane? say, put empty rows so that the pane will be filled.

Thanks

like image 686
Leon Avatar asked May 13 '11 21:05

Leon


1 Answers

table.setFillsViewportHeight( true );
like image 65
camickr Avatar answered Nov 14 '22 23:11

camickr