Skip to content

Commit

Permalink
4819544: SwingSet2 JTable Demo throws NullPointerException
Browse files Browse the repository at this point in the history
Backport-of: 64d18d45ef885d5cdd893b7f56236d3f22b4b84c
  • Loading branch information
akashche committed Nov 5, 2021
1 parent 0ab99ed commit 9a2c123
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/demo/share/jfc/SwingSet2/TableDemo.java
Original file line number Diff line number Diff line change
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 9a2c123

@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.