Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public DefaultTableModel generateTableModel(ArrayList<String[]> array, String[] columnNames){
- tableModel = new DefaultTableModel(null, columnNames){
- public boolean isCellEditable(int row, int column){
- return false;
- }
- };
- for(String[] tmp: array) {
- Object[] tableRow = new Object[tableModel.getColumnCount()];
- for(int i = 0; i < tmp.length; i++){
- tableRow[i] = tmp[i];
- }
- tableModel.addRow(tableRow);
- }
- return tableModel;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement