BH - suggestion to turn off column dragging in Java (and JavaScript)
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Sun, 18 Nov 2018 06:02:15 +0000 (00:02 -0600)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Sun, 18 Nov 2018 06:02:15 +0000 (00:02 -0600)
src/jalview/gui/FeatureSettings.java

index 4f3d7b9..7b708ab 100644 (file)
@@ -98,6 +98,7 @@ import javax.swing.ToolTipManager;
 import javax.swing.border.Border;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+import javax.swing.plaf.TableUI;
 import javax.swing.table.AbstractTableModel;
 import javax.swing.table.TableCellEditor;
 import javax.swing.table.TableCellRenderer;
@@ -239,6 +240,7 @@ public class FeatureSettings extends JPanel
         
         return tip;
       }
+      
 
       /**
        * Position the tooltip near the bottom edge of, and half way across, the
@@ -255,6 +257,12 @@ public class FeatureSettings extends JPanel
         return loc;
       }
     };
+    
+    // next line is needed to avoid (quiet) exceptions thrown
+    // when column ordering changes so that the above constants
+    // no longer apply.
+    table.getTableHeader().setReorderingAllowed(false); // BH 2018
+    
     table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12));
     ToolTipManager.sharedInstance().registerComponent(table);