W2R3 – Update the JRadioButton name -- improved debugging in console to make it more human readable.

This commit is contained in:
bobbert committed 2025-02-04 20:00:47 +00:00
1 parent 9c8bf7f7b8
commit db3e4dc327
1 file changed
+4 -4
@@ -43,7 +43,7 @@ public class MainViewer {
ActionListener EditListener = e -> {
System.out.println("Edit Button clicked for Row: " + row + "\n- with Radio Button Text as: " + JR.getText() + "\n- For tab: " + Pname);
DialogueBox(JR.getText(), JR, row);
DialogueBox(JR.getText(), JR, row, Pname);
};
JEdit.addActionListener(EditListener);
@@ -55,7 +55,7 @@ public class MainViewer {
}
public void DialogueBox(String JRtext, JRadioButton JR, int row){
public void DialogueBox(String JRtext, JRadioButton JR, int row, String Pname){
JTextField JT = new JTextField(JRtext);
@@ -79,10 +79,10 @@ public class MainViewer {
if (choice == JOptionPane.OK_OPTION)
{
System.out.println("OK option pressed and set text to: " + JT.getText() + " for row :" + row);
System.out.println("OK option pressed and set text to: " + JT.getText() + " for row :" + row + "\n- in Tab: " + Pname);
JR.setText(JT.getText());
} else if (choice == JOptionPane.CANCEL_OPTION) {
System.out.println("Cancel option pressed.");
System.out.println("Cancel option pressed." + "\n- in Tab: " + Pname);
dialog.dispose();
}
}