Posted: Thu Jun 02, 2005 7:47 pm Post subject: dialog box
i was just wondering if anyone can help me out creating a dialog box that allows the user to enter a string (ie. their name) and then closes when they are done
Sponsor Sponsor
Hikaru79
Posted: Thu Jun 02, 2005 7:58 pm Post subject: (No subject)
Java:
String s = (String)JOptionPane.showInputDialog(null,"What is your name?",
"Answer me these questions three!",
JOptionPane.PLAIN_MESSAGE,
null,
null,
"ilovechicken");
System.out.println(s);
There you go Of course, swing must be imported for JOptionPane to be found.
ilovechicken
Posted: Thu Jun 02, 2005 8:24 pm Post subject: heh?
swing must be imported? is that like a
import swing.*;
or something?
wtd
Posted: Thu Jun 02, 2005 9:03 pm Post subject: Re: heh?
ilovechicken wrote:
swing must be imported? is that like a
import swing.*;
or something?
javax.swing.*, actually.
Check out the API reference at java.sun.com.
ilovechicken
Posted: Thu Jun 02, 2005 10:25 pm Post subject: wow
wow, that is unbelievably efficient and easy. thanks a lot.