1768 |
// If the structure changes, we need to revalidate, since that might |
// If the structure changes, we need to revalidate, since that might |
1769 |
// affect the size parameters of the JTable. Otherwise we only need |
// affect the size parameters of the JTable. Otherwise we only need |
1770 |
// to perform a repaint to update the view. |
// to perform a repaint to update the view. |
1771 |
if (event.getType() == TableModelEvent.INSERT |
if (event.getType() == TableModelEvent.INSERT) |
|
|| event.getType() == TableModelEvent.DELETE) |
|
1772 |
revalidate(); |
revalidate(); |
1773 |
|
else if (event.getType() == TableModelEvent.DELETE) |
1774 |
|
{ |
1775 |
|
if (dataModel.getRowCount() == 0) |
1776 |
|
clearSelection(); |
1777 |
|
revalidate(); |
1778 |
|
} |
1779 |
repaint(); |
repaint(); |
1780 |
} |
} |
1781 |
|
|
1895 |
* @return The current value of the selectedRow property |
* @return The current value of the selectedRow property |
1896 |
*/ |
*/ |
1897 |
public int getSelectedRow () |
public int getSelectedRow () |
1898 |
{ |
{ |
1899 |
return selectionModel.getMinSelectionIndex(); |
return selectionModel.getMinSelectionIndex(); |
1900 |
} |
} |
1901 |
|
|