After running some apps that work fine with Sun and IBM, I got several
NPEs with JTable.
2005-10-18 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/JTable.java
(JTable): Moved code around so all models are set before
any other function is called. Prevents all NPEs with
models.
Index: javax/swing/JTable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.52
diff -u -r1.52 JTable.java
--- javax/swing/JTable.java 12 Oct 2005 19:57:28 -0000 1.52
+++ javax/swing/JTable.java 18 Oct 2005 19:21:37 -0000
@@ -671,19 +671,17 @@
*/
public JTable (TableModel dm, TableColumnModel cm, ListSelectionModel sm)
{
- setModel(dm == null ? createDefaultDataModel() : dm);
- setSelectionModel(sm == null ? createDefaultSelectionModel() : sm);
-
+ boolean autoCreate = false;
if (cm != null)
- {
setColumnModel(cm);
- setAutoCreateColumnsFromModel(false);
- }
else
{
setColumnModel(createDefaultColumnModel());
- setAutoCreateColumnsFromModel(true);
+ autoCreate = true;
}
+ setModel(dm == null ? createDefaultDataModel() : dm);
+ setSelectionModel(sm == null ? createDefaultSelectionModel() : sm);
+ setAutoCreateColumnsFromModel(autoCreate);
initializeLocalVars();
// The next two lines are for compliance with the JDK which starts
// the JLists associated with a JTable with both lead selection
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches