So I am new to GUI and I have the following code:
import javax.swing.*;
public class GUItest
{
String number = JOptionPane.showInputDialog("Enter a number betch");
int num_1 = Integer.parseInt(number);
int product = (num_1*2);
JOptionPane.showMessageDialog(null, "Your product is" + product,"Title", JOptionPane.PLAIN_MESSAGE)
}
So my question is how come when I used JOption
in the first case (I mean showInputDialog
) it worked with no problems but then when I try to use showMEssageDialog
the drop down menu wont even appear and many different syntax errors pop up.