Can anyone tell me how to create a table without a table header?
I am making Sudoku puzzle and I want to create a table without the table header in Java. Is it possible?
Click anywhere in the table. Go to the Table tab on the Ribbon. In the Table Style Options group, select the Header Row check box to hide or display the table headers.
JTable(): A table is created with empty cells. JTable(int rows, int cols): Creates a table of size rows * cols. JTable(Object[][] data, Object []Column): A table is created with the specified name where []Column defines the column names.
I don't think that you want your Sudoku to scroll, so the easiest way should be not to put your table into a JScrollPane
, which is responsible for displaying the header:
The other way is to call
table.setTableHeader(null);
Anyone having problems with the suggested methods, try the following:
jTable.getTableHeader().setUI(null);
This is tested with Java 8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With