Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
4819544: SwingSet2 JTable Demo throws NullPointerException
Reviewed-by: phh, mbaesken
Backport-of: 64d18d4
  • Loading branch information
GoeLin committed Oct 11, 2022
1 parent 53092b3 commit df6d5f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/demo/share/jfc/SwingSet2/TableDemo.java
Expand Up @@ -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; }
};
Expand Down

1 comment on commit df6d5f8

@openjdk-notifier
Copy link

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.