[Schmitzm-commits] r1606 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 9 20:46:44 CEST 2011


Author: mojays
Date: 2011-06-09 20:46:43 +0200 (Thu, 09 Jun 2011)
New Revision: 1606

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SortableJTable.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
Log:


Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SortableJTable.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SortableJTable.java	2011-06-08 16:16:08 UTC (rev 1605)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SortableJTable.java	2011-06-09 18:46:43 UTC (rev 1606)
@@ -135,6 +135,8 @@
    * the table model.
    */
   public int getSelectedModelRow() {
+    if ( getSelectedRow() < 0 )
+      return -1;
     return convertRowIndexToModel(getSelectedRow());
   }
 

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2011-06-08 16:16:08 UTC (rev 1605)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2011-06-09 18:46:43 UTC (rev 1606)
@@ -78,6 +78,7 @@
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
 import javax.swing.JLabel;
+import javax.swing.JList;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
@@ -829,8 +830,8 @@
         ((JComboBox)component).setEnabled(editable);
       if ( component instanceof JCheckBox )
         ((JCheckBox)component).setEnabled(editable);
-      if ( component instanceof JCheckBox )
-        ((JCheckBox)component).setEnabled(editable);
+      if ( component instanceof JList )
+        ((JList)component).setEnabled(editable);
       if ( component instanceof JDateChooser )
         ((JDateChooser)component).setEnabled(editable);
       



More information about the Schmitzm-commits mailing list