Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: "showMessageDialog" method in swing package

  1. #1
    Junior Member
    Join Date
    May 2010
    Location
    Ratnapura,Sri Lanka
    Posts
    8
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question "showMessageDialog" method in swing package

    import javax.swing.JOptionPane;
    class my11{
    	public static void main(String arg[]){
    		JOptionPane.showMessageDialog(null,"Hello \n how are you? ");
    	}
    }
    Please be kind to reply, what are the other values that we can pass to call the above method except "null"


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: "showMessageDialog" method in swing package

    As taken from the Javadoc.

    JOptionPane.showMessageDialog(parentComponent, message, title, messageType, icon)
    Parameters:
    parentComponent determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used
    message the Object to display
    title the title string for the dialog
    messageType the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
    icon an icon to display in the dialog that helps the user identify the kind of message that is being displayed
    // Json

  3. The Following User Says Thank You to Json For This Useful Post:

    Delmi (May 14th, 2010)

Similar Threads

  1. Replies: 1
    Last Post: March 31st, 2010, 09:42 PM
  2. Replies: 1
    Last Post: March 15th, 2010, 10:03 PM
  3. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 08:35 AM
  4. Replies: 1
    Last Post: October 25th, 2009, 11:54 AM
  5. Replies: 4
    Last Post: August 13th, 2009, 05:54 AM