Skip to content
Permalink
Browse files
4819544: SwingSet2 JTable Demo throws NullPointerException
Backport-of: 64d18d45ef885d5cdd893b7f56236d3f22b4b84c
  • Loading branch information
akashche committed Nov 5, 2021
1 parent 0ab99ed commit 9a2c123ddff7dc68b1b2fc479bdd5e0638aba73c
Showing 1 changed file with 4 additions and 1 deletion.
@@ -549,7 +549,10 @@ public JScrollPane createTable() {
public int getRowCount() { return data.length;}
public Object getValueAt(int row, int col) {return data[row][col];}
public String getColumnName(int column) {return names[column];}
public Class<?> getColumnClass(int c) {return getValueAt(0, c).getClass();}
public Class<?> getColumnClass(int c) {
Object obj = getValueAt(0, c);
return obj != null ? obj.getClass() : Object.class;
}
public boolean isCellEditable(int row, int col) {return col != 5;}
public void setValueAt(Object aValue, int row, int column) { data[row][column] = aValue; }
};

1 comment on commit 9a2c123

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 9a2c123 Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.