Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Saturday, 14 April 2012

Java Input Dialog Example

Java Input Dialog : Sample Code
Using Swing Package



import javax.swing.*;
/**
 *
 * @author Muhammad Farrukh
 */
public class InputMessage {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        JOptionPane.showInputDialog(null, "enter something");
    }
}

Output of this code will be:



JOption Pane-Java Swing Package

Java Swing Package usage Example:
To show a Simple Dialog in Java .

/**
 *
 * @author Muhammad Farrukh
 */
import javax.swing.*;
public class JavaDialog {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        JOptionPane.showMessageDialog(null, "You are Visiting \n\n digicom007.blogspot.com");
        JOptionPane.showMessageDialog(null, "Thank You to visit my site");
        JOptionPane.showMessageDialog(null, "By The Owner \n Muhammad Farrukh \n BSCS\n 7th Semester\nVirtual University of Pakistan");
        System.exit(0);
    }
}

Output if this sample code will be:
First Dialog Command

2nd Dialog Command

3rd Dialog Command


Sunday, 25 March 2012

Java How to Program, 9/e, Early Objects Version

Java How to Program, 9/e, Early Objects Version

Web Design and development tutorial. Java Web Development Material


Reference:     http://www.deitel.com/Default.aspx

Link