Skip to content

Commit

Permalink
FIX 移动列导致的编码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
huage2580 committed Apr 12, 2021
1 parent 777f9b0 commit 28f222d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/FundWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/StockWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/handler/FundRefreshHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class FundRefreshHandler extends DefaultTableModel {
/**
* 存放【编码】的位置,更新数据时用到
*/
private int codeColumnIndex;
public int codeColumnIndex;

private JTable table;
private boolean colorful = true;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/handler/StockRefreshHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class StockRefreshHandler extends DefaultTableModel {
/**
* 存放【编码】的位置,更新数据时用到
*/
private int codeColumnIndex;
public int codeColumnIndex;

private JTable table;
private boolean colorful = true;
Expand Down

0 comments on commit 28f222d

Please sign in to comment.