I have a java GUI form in written in Swing, and I want to prompt a input dialog when the form is loaded. My approach was to put the prompt in the class's run method:
public static void main(String args[])
{
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable()
{
public void run()
{
new form_editStu().setVisible(true);
promptUser();
}
});
void promptUser()
{
JOptionPane.showinputDialog("Enter value:");
}
}
Nothing happens. Any ideas?
Thanks.