Setting the height of a row in a JTable in java

MaRX

New Member
I have been searching for a solution to be able to increase the height of a row in a JTable. I have been using the setRowHeight(int int) method which compiles and runs OK, but no row have been increased. When I use the getRowHeight(int) mehtod of the row I set the height to, it does print out the size I increased the row to, so I'm not sure what is wrong. The code below is a rough illustration how I am trying to solve it. My class extends JFrame.\[code\]String[] columnNames = {"Column 1", "Column 2", "Column 1 3"};JTable table = new JTable(new DefaultTableModel(columnNames, people.size()));DefaultTableModel model = (DefaultTableModel) table.getModel();int count =1;for(Person p: people){ model.insertRow(count,(new Object[]{count, p.getName(), p.getAge()+"", p.getNationality})); count++;}table.setRowHeight(1, 15);//Try set height to 15 (I've tried higher)\[/code\]Can anyone tell me where I am going wrong? I am trying to increase the height of row 1 to 15 pixels?Thanks much appreciated
 
Top