i've read the javadoc of removeAll() method, but i don't understand so well what will happen. I need to remove all data contained in myJtable, and adding new data. removeAll will remove only data inside table?
that's how i've declared my jtable:
JTable table = new JTable(new DefaultTableModel(info, myHeader)) {
@Override
public boolean isCellEditable(int row, int column) {
//disable table editing
return false;
}
};
header = table.getTableHeader();
header.setBackground(Color.GREEN);
JScrollPane scroll_pane = new JScrollPane(table);
//hide column
table.removeColumn(table.getColumnModel().getColumn(1));
//scrollbar insert
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
//disable dragging and resizing column
table.getTableHeader().setReorderingAllowed(false);
table.getTableHeader().setResizingAllowed(false);
table.addMouseListener(new JTableRowListener(table));
where args of JTable constructor are String arrays