W2R2 –Bring up a Dialog Box -- passed on JRadioButton text as well. Temporarily renamed radio buttons to easily distinguish between them...

This commit is contained in:
bobbert committed 2025-02-04 18:03:42 +00:00
1 parent 7b81ac78e2
commit 25cb72aafc
1 file changed
+13 -4
@@ -24,7 +24,13 @@ public class MainViewer {
int row = count+1;
String name = "Name";
//String name = "Name";
// Temporary row distinguishing rename
String name = "Row " + row + " Name";
// end of temporary row rename
JRadioButton JR = new JRadioButton(name); // temporary use of name as label for JRadioButton - to allow for the use of text being manipulated // changed.
JButton JEdit = new JButton("Edit");
@@ -39,7 +45,8 @@ public class MainViewer {
ActionListener buttonListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Edit Button clicked for Row: " + row + "with Radio Button Text as: " + JR.getText());
System.out.println("Edit Button clicked for Row: " + row + " with Radio Button Text as: " + JR.getText());
DialogueBox(JR.getText());
}
};
@@ -48,8 +55,10 @@ public class MainViewer {
}
public void DialogueBox(){
public void DialogueBox(String JRtext){
JOptionPane pane = new JOptionPane(JRtext);
JDialog dialog = pane.createDialog("Change Name to what?");
dialog.show();
}