From: gmungoc Date: Mon, 19 Nov 2018 15:48:53 +0000 (+0000) Subject: JAL-3154 disable drag to reorder JTable columns X-Git-Tag: Release_2_11_0~17^2~87^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-3154tableColumnDrag;p=jalview.git JAL-3154 disable drag to reorder JTable columns --- diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 1358c8f..6cc027c 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -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()); diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 6807382..9023864 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -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); diff --git a/src/jalview/jbgui/GWsPreferences.java b/src/jalview/jbgui/GWsPreferences.java index c3fd4fa..579d409 100644 --- a/src/jalview/jbgui/GWsPreferences.java +++ b/src/jalview/jbgui/GWsPreferences.java @@ -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);