Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a2c123

Browse files
committed
4819544: SwingSet2 JTable Demo throws NullPointerException
Backport-of: 64d18d45ef885d5cdd893b7f56236d3f22b4b84c
1 parent0ab99ed commit9a2c123

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/demo/share/jfc/SwingSet2/TableDemo.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,10 @@ public JScrollPane createTable() {
549549
publicintgetRowCount() {returndata.length;}
550550
publicObjectgetValueAt(introw,intcol) {returndata[row][col];}
551551
publicStringgetColumnName(intcolumn) {returnnames[column];}
552-
publicClass<?>getColumnClass(intc) {returngetValueAt(0,c).getClass();}
552+
publicClass<?>getColumnClass(intc) {
553+
Objectobj =getValueAt(0,c);
554+
returnobj !=null ?obj.getClass() :Object.class;
555+
}
553556
publicbooleanisCellEditable(introw,intcol) {returncol !=5;}
554557
publicvoidsetValueAt(ObjectaValue,introw,intcolumn) {data[row][column] =aValue; }
555558
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp