so, i'm learning about Java JOptionPane, and i want to make another question that refer to the question before that and get the input from the question, but it seem like i can't get the variable right ??
int papamoney = JOptionPane.YES_NO_OPTION;
JOptionPane.showConfirmDialog(null, "Do your father work?", null, papamoney);
if (papamoney == JOptionPane.YES_OPTION){
String x = (String)JOptionPane.showInputDialog(null, "How much is your father salary", "Type salary in rupiah");
}
System.out.println ("Your dad salary per month is " + x);
and here it seems like the string x from the question is un-used while the compiler say that variable x cannot be found?
sorry if my english is not perfect