I just love the Swing library of Java for desktop GUI development. Here’s a very simple example of JOptionPane that prompts for the user’s name and then displays it inside another dialog box.
import javax.swing.JOptionPane; public class masnun { public static void main(String args[]) { String Name = JOptionPane.showInputDialog("What is your name? "); JOptionPane.showMessageDialog(null,"Your name is " + Name); } }
Save it as “masnun.java” and run after compilation
It’s really cool !
Pingback: Tweets that mention JOptionPane – Swing with Java | maSnun.com -- Topsy.com
nice post thanks bro..:)