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 19:59:26 +00:00
1 parent 1848ffbbf9
commit 9c8bf7f7b8
1 file changed
+4 -4
@@ -19,7 +19,7 @@ public class MainViewer {
public int a = 3; // this represents a value that is to declare how many rows are to be made public int a = 3; // this represents a value that is to declare how many rows are to be made
private void CreateRow(int count, JPanel jp) // Function to create a row // holds all the data of a row in the grid layout below. private void CreateRow(int count, JPanel jp, String Pname) // Function to create a row // holds all the data of a row in the grid layout below.
{ {
int row = count+1; int row = count+1;
@@ -42,13 +42,13 @@ public class MainViewer {
System.out.println("Row number: "+ row + " Has been created!"); System.out.println("Row number: "+ row + " Has been created!");
ActionListener EditListener = e -> { ActionListener EditListener = e -> {
System.out.println("Edit Button clicked for Row: " + row + "\n- with Radio Button Text as: " + JR.getText()); 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);
}; };
JEdit.addActionListener(EditListener); JEdit.addActionListener(EditListener);
ActionListener RadioListener = e -> { 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 changed to: " + JR.isSelected()); System.out.println("Radio Button toggled for Row: " + row + "\n- with Radio Button Text as: " + JR.getText() + "\n- With state of radio button changed to: " + JR.isSelected() + "\n- For tab: " + Pname);
}; };
JR.addActionListener(RadioListener); JR.addActionListener(RadioListener);
@@ -102,7 +102,7 @@ public class MainViewer {
for (int i=0; i<a; i++) for (int i=0; i<a; i++)
{ {
CreateRow(i, page); CreateRow(i, page, Pname);
} }
} }