diff --git a/src/main/java/userprofilebuilder/view/MainViewer.java b/src/main/java/userprofilebuilder/view/MainViewer.java index ca2e304..391f32f 100644 --- a/src/main/java/userprofilebuilder/view/MainViewer.java +++ b/src/main/java/userprofilebuilder/view/MainViewer.java @@ -42,15 +42,20 @@ public class MainViewer { System.out.println("Row number: "+ row + " Has been created!"); ActionListener EditListener = e -> { - System.out.println("Edit Button clicked for Row: " + row + " with Radio Button Text as: " + JR.getText()); - DialogueBox(JR.getText(), JR); + System.out.println("Edit Button clicked for Row: " + row + "\n- with Radio Button Text as: " + JR.getText()); + DialogueBox(JR.getText(), JR, row); }; JEdit.addActionListener(EditListener); + ActionListener RadioListener = e -> { + System.out.println("Radio Button toggled for Row: " + row + "\n- with Radio Button Text as: " + JR.getText() + "\n- With state of radio button as: " + JR.isSelected()); + }; + JR.addActionListener(RadioListener); + } - public void DialogueBox(String JRtext, JRadioButton JR){ + public void DialogueBox(String JRtext, JRadioButton JR, int row){ JTextField JT = new JTextField(JRtext); @@ -74,7 +79,7 @@ public class MainViewer { if (choice == JOptionPane.OK_OPTION) { - System.out.println("OK option pressed and set text to: " + JT.getText()); + System.out.println("OK option pressed and set text to: " + JT.getText() + " for row :" + row); JR.setText(JT.getText()); } else if (choice == JOptionPane.CANCEL_OPTION) { System.out.println("Cancel option pressed.");