public void tableDisplay() { String[] columnNames = { "Title", "First Name", "Last Name", "Publisher", "ISBN", "Year"}; Object[][] data = htemp.getMatrix(); table = new JTable(data, columnNames) { public boolean isCellEditable( int row, int col ) { return false; } }; table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); }