I have created a JRadioButton
called ConcatS
, so if it is selected the input dialog box pop up and that input string I wanted to use in JButton
called "Ok" i.e OperationOkActionPerformed
method.
I'm using Java reflection to get private method's variable string, but couldn't get it working.
I'm using Java Swing.
private void OperationOKActionPerformed(java.awt.event.ActionEvent evt) {
if (LenS.isSelected()) {
String s = InputString.getText();
int l = s.length();
OutPut.setText(Integer.toString(l));
}
if (ConcatS.isSelected()) {
Method s2 = Operations.class.getDeclaredMethod("ConcatSActionperformed", null);
}
}
private void ConcatSActionPerformed(java.awt.event.ActionEvent evt) {
String s1 = JOptionPane.showInputDialog("Input Second String");
}
Aucun commentaire:
Enregistrer un commentaire