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:
1 parent
7b81ac78e2
commit
25cb72aafc
1 file changed
+12
-3
@@ -24,7 +24,13 @@ public class MainViewer {
|
|||||||
|
|
||||||
|
|
||||||
int row = count+1;
|
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.
|
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");
|
JButton JEdit = new JButton("Edit");
|
||||||
@@ -40,6 +46,7 @@ public class MainViewer {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user