From 58922b9dd9afcf0c284834dd160a08703450f701 Mon Sep 17 00:00:00 2001 From: hansonr Date: Sun, 18 Nov 2018 00:02:15 -0600 Subject: [PATCH] BH - suggestion to turn off column dragging in Java (and JavaScript) --- src/jalview/gui/FeatureSettings.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 4f3d7b9..7b708ab 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -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); -- 1.7.10.2