From 28f222dd28c827c6cfd2370aca5ef5471ff4972a Mon Sep 17 00:00:00 2001 From: hua <2838666797@qq.com> Date: Mon, 12 Apr 2021 10:37:27 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E7=A7=BB=E5=8A=A8=E5=88=97=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E7=BC=96=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/FundWindow.java | 2 +- src/main/java/StockWindow.java | 2 +- src/main/java/handler/FundRefreshHandler.java | 2 +- src/main/java/handler/StockRefreshHandler.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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;