Skip to content

Commit

Permalink
Fixed out of bounds exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mtygesen committed Apr 18, 2024
1 parent 1f687ce commit 93d2c4a
Showing 1 changed file with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,25 +521,30 @@ private void initVerificationButtons() {
gbc.gridx = 1;
optionsPanel.add(copyOptionButton, gbc);
copyOptionButton.addActionListener(e -> {
int row = verificationTable.getSelectedRow();
optionsTable.addRow(new Object[]{
verificationTable.getValueAt(row, 0),
optionsTable.getRowCount(),
verificationTable.getValueAt(row, 2),
verificationTable.getValueAt(row, 3),
verificationTable.getValueAt(row, 4)
});
int selectedRow = verificationTable.getSelectedRow();
if (selectedRow != -1) {
optionsTable.addRow(new Object[]{
verificationTable.getValueAt(selectedRow, 0),
optionsTable.getRowCount(),
verificationTable.getValueAt(selectedRow, 2),
verificationTable.getValueAt(selectedRow, 3),
verificationTable.getValueAt(selectedRow, 4)
});
}
});

JButton removeOptionButton = new JButton("Remove");
gbc.gridx = 2;
optionsPanel.add(removeOptionButton, gbc);
removeOptionButton.addActionListener(e -> {
optionsTable.removeRow(verificationTable.getSelectedRow());
for (int rowIndex = 0; rowIndex < verificationTable.getRowCount(); rowIndex++) {
verificationTable.setValueAt(rowIndex, rowIndex, 1);
}
});
int selectedRow = verificationTable.getSelectedRow();
if (selectedRow != -1) {
optionsTable.removeRow(selectedRow);
for (int rowIndex = 0; rowIndex < verificationTable.getRowCount(); rowIndex++) {
verificationTable.setValueAt(rowIndex, rowIndex, 1);
}
}
});

helpDialogPN = new HelpDialog(
BatchProcessingDialog.this,
Expand Down

0 comments on commit 93d2c4a

Please sign in to comment.