From bee0924062194f8b8b49d373b56be4e400af5933 Mon Sep 17 00:00:00 2001 From: jazzjaikla Date: Tue, 7 May 2024 11:25:39 +0700 Subject: [PATCH] Invalid cultivar selection --- src/ListDialog/CultivarListDialog.java | 2 +- src/xbuild/CultivarsFrame.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ListDialog/CultivarListDialog.java b/src/ListDialog/CultivarListDialog.java index 95dc262..d692884 100644 --- a/src/ListDialog/CultivarListDialog.java +++ b/src/ListDialog/CultivarListDialog.java @@ -199,7 +199,7 @@ private void AddDataToTable(Cultivar cul) { cbCrop.setVisible(false); jLabel1.setVisible(false); jLabel2.setVisible(false); - cbCultivar.setInit(null, "INGENO", cul != null ? cul.INGENO : "", CultivarList.GetAt(FileX.general.crop), new XColumn[]{new XColumn("CulName", "Cultivar Name", 200)}, "CropCode"); + cbCultivar.setInit(null, "INGENO", cul != null ? cul.INGENO : "", CultivarList.GetAt(FileX.general.crop), new XColumn[]{new XColumn("CulName", "Cultivar Name", 200)}, "CulCode"); this.setPreferredSize(new Dimension(this.getPreferredSize().width, 590)); EventQueue.invokeLater(() -> { diff --git a/src/xbuild/CultivarsFrame.java b/src/xbuild/CultivarsFrame.java index 11136f1..d53a372 100644 --- a/src/xbuild/CultivarsFrame.java +++ b/src/xbuild/CultivarsFrame.java @@ -132,7 +132,7 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { private void jXTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jXTable1MouseClicked if (evt.getClickCount() == 2) { - int nRow = jXTable1.getSelectedRow(); + int nRow = jXTable1.getSelectedRow() + 1; Cultivar culEdit = (Cultivar) FileX.cultivars.GetAt(nRow); final CultivarListDialog dialog = new CultivarListDialog(null, culEdit, true);