contoh JOptionPane

import javax.swing.*;

/**
 * JOptionPane showInputDialog example #1.
 * A simple showInputDialog example.
 * @author alvin alexander, http://alvinalexander.com
 */
public class JOptionPaneShowInputDialogExample1
{
  public static void main(String[] args)
  {
    // a jframe here isn't strictly necessary, but it makes the example a little more real
    JFrame frame = new JFrame("InputDialog Example #1");

    // prompt the user to enter their name
    String name = JOptionPane.showInputDialog(frame, "What's your name?");

JOptionPane.showMessageDialog(frame,"my name is "+name);
    // get the user's input. note that if they press Cancel, 'name' will be null
    System.out.printf("The user's name is '%s'.\n", name);
 System.exit(0);
  }
}
//original source: http://alvinalexander.com/java/joptionpane-showinputdialog-examples
    



Comments

  1. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly..

    Java Training in Chennai | Java Training Institute in Chennai

    ReplyDelete
  2. This is a wonderful blog. Keep up the good work. java training in chennai

    ReplyDelete

  3. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas. block chain training in chennai|Selenium training in chennai

    ReplyDelete
  4. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

Lab Network 2024

Step to publish your static html web page to GitHub

Tutorial OOP(reversion java)