diff --git a/src/main/java/FundWindow.java b/src/main/java/FundWindow.java index e5dd263..8e904ff 100644 --- a/src/main/java/FundWindow.java +++ b/src/main/java/FundWindow.java @@ -103,7 +103,7 @@ public void mouseDragged(MouseEvent e) { public void mousePressed(MouseEvent e) { if (table.getSelectedRow() < 0) return; - String code = String.valueOf(table.getModel().getValueAt(table.convertRowIndexToModel(table.getSelectedRow()), 0)); + String code = String.valueOf(table.getModel().getValueAt(table.convertRowIndexToModel(table.getSelectedRow()), fundRefreshHandler.codeColumnIndex));//FIX 移动列导致的BUG if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) { // 鼠标左键双击 try { diff --git a/src/main/java/StockWindow.java b/src/main/java/StockWindow.java index f42a9b6..2ce6929 100644 --- a/src/main/java/StockWindow.java +++ b/src/main/java/StockWindow.java @@ -66,7 +66,7 @@ public void mouseDragged(MouseEvent e) { public void mousePressed(MouseEvent e) { if (table.getSelectedRow() < 0) return; - String code = String.valueOf(table.getModel().getValueAt(table.convertRowIndexToModel(table.getSelectedRow()), 0)); + String code = String.valueOf(table.getModel().getValueAt(table.convertRowIndexToModel(table.getSelectedRow()), handler.codeColumnIndex));//FIX 移动列导致的BUG if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) { // 鼠标左键双击 try { diff --git a/src/main/java/handler/FundRefreshHandler.java b/src/main/java/handler/FundRefreshHandler.java index f507a37..9a81ca5 100644 --- a/src/main/java/handler/FundRefreshHandler.java +++ b/src/main/java/handler/FundRefreshHandler.java @@ -22,7 +22,7 @@ public abstract class FundRefreshHandler extends DefaultTableModel { /** * 存放【编码】的位置,更新数据时用到 */ - private int codeColumnIndex; + public int codeColumnIndex; private JTable table; private boolean colorful = true; diff --git a/src/main/java/handler/StockRefreshHandler.java b/src/main/java/handler/StockRefreshHandler.java index 92a7c12..8cc456b 100644 --- a/src/main/java/handler/StockRefreshHandler.java +++ b/src/main/java/handler/StockRefreshHandler.java @@ -22,7 +22,7 @@ public abstract class StockRefreshHandler extends DefaultTableModel { /** * 存放【编码】的位置,更新数据时用到 */ - private int codeColumnIndex; + public int codeColumnIndex; private JTable table; private boolean colorful = true;