JScrollPane not refresing
Ok, you all helped me get my JTable to show up correctly and I thank you for that! Now I am having trouble getting it to scroll correctly. When the JScrollPane scrolls off of the initial viewport it will not refresht the column headers however it will refresh the data within those columns. Any idea why? Here is code snipit. *Note: this is not my real code but this code behaves the same ways as my real code. Real code has nonstandard classes, so I post this code with standard classes to try to get some help.*
DefaultTableModel model =new DefaultTableModel();
JTable table =new JTable(model);
table.setModel(model);
JScrollPane scp =new JScrollPane(table);
//set preferred seizs
table.setPreferredSize(new Dimension(600, 200));
scp.setPreferredSize(new Dimension(400, 200));
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.setModel(model);
//set table data and headers
Object[] temp =new Object[]{"Rate ","Rule","Rounding ","Decimal "};
model.setColumnIdentifiers(temp);
model.fireTableStructureChanged();
Object[] temp1 =new Object[]{"1","2","3","4"};
model.addRow(temp1);
model.fireTableRowsInserted(0, model.getRowCount());

