JAL-3154 disable drag to reorder JTable columns bug/JAL-3154tableColumnDrag
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 19 Nov 2018 15:48:53 +0000 (15:48 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 19 Nov 2018 15:48:53 +0000 (15:48 +0000)
src/jalview/gui/FeatureSettings.java
src/jalview/jbgui/GPreferences.java
src/jalview/jbgui/GWsPreferences.java

index 1358c8f..6cc027c 100644 (file)
@@ -95,6 +95,7 @@ import javax.swing.SwingConstants;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.table.AbstractTableModel;
+import javax.swing.table.JTableHeader;
 import javax.swing.table.TableCellEditor;
 import javax.swing.table.TableCellRenderer;
 import javax.swing.table.TableColumn;
@@ -222,7 +223,9 @@ public class FeatureSettings extends JPanel
         return tip;
       }
     };
-    table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12));
+    JTableHeader tableHeader = table.getTableHeader();
+    tableHeader.setFont(new Font("Verdana", Font.PLAIN, 12));
+    tableHeader.setReorderingAllowed(false);
     table.setFont(new Font("Verdana", Font.PLAIN, 12));
 
     // table.setDefaultRenderer(Color.class, new ColorRenderer());
index 6807382..9023864 100755 (executable)
@@ -584,6 +584,7 @@ public class GPreferences extends JPanel
     linkTab.setLayout(new GridBagLayout());
 
     // Set up table for Url links
+    linkUrlTable.getTableHeader().setReorderingAllowed(false);
     linkUrlTable.setFillsViewportHeight(true);
     linkUrlTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
     linkUrlTable.setAutoCreateRowSorter(true);
index c3fd4fa..579d409 100644 (file)
@@ -296,6 +296,7 @@ public class GWsPreferences extends JPanel
     wsListPane.setBorder(BorderFactory.createEtchedBorder());
     wsListPane.getViewport().add(wsList);
     wsList.setPreferredSize(new Dimension(482, 202));
+    wsList.getTableHeader().setReorderingAllowed(false);
     wsListPane.setPreferredSize(new Dimension(380, 80));
     wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     wsList.setColumnSelectionAllowed(false);