Saturday, March 8, 2008

JAVA Lesson 3

Writing the first GUI program:
-------------------------------------

import javax.swing.JOptionPane;

public class MyFirstGUI{

public static void main(String args[]){
String name = JOptionPane.showInputDialog("Enter your name");
JOptionPane.showMessageDialog(null,"Your name is : \"" + name + "\"");

// \" is to print the double quotation mark

}
}
---------------*---------------
Screenshot: