671 |
*/ |
*/ |
672 |
public JTable (TableModel dm, TableColumnModel cm, ListSelectionModel sm) |
public JTable (TableModel dm, TableColumnModel cm, ListSelectionModel sm) |
673 |
{ |
{ |
674 |
setModel(dm == null ? createDefaultDataModel() : dm); |
boolean autoCreate = false; |
|
setSelectionModel(sm == null ? createDefaultSelectionModel() : sm); |
|
|
|
|
675 |
if (cm != null) |
if (cm != null) |
|
{ |
|
676 |
setColumnModel(cm); |
setColumnModel(cm); |
|
setAutoCreateColumnsFromModel(false); |
|
|
} |
|
677 |
else |
else |
678 |
{ |
{ |
679 |
setColumnModel(createDefaultColumnModel()); |
setColumnModel(createDefaultColumnModel()); |
680 |
setAutoCreateColumnsFromModel(true); |
autoCreate = true; |
681 |
} |
} |
682 |
|
setModel(dm == null ? createDefaultDataModel() : dm); |
683 |
|
setSelectionModel(sm == null ? createDefaultSelectionModel() : sm); |
684 |
|
setAutoCreateColumnsFromModel(autoCreate); |
685 |
initializeLocalVars(); |
initializeLocalVars(); |
686 |
// The next two lines are for compliance with the JDK which starts |
// The next two lines are for compliance with the JDK which starts |
687 |
// the JLists associated with a JTable with both lead selection |
// the JLists associated with a JTable with both lead selection |