Project

General

Profile

Bug #5012 » JOptionPaneTest.java

Christopher Brooks, 05/15/2010 10:59 AM

 
1
import javax.swing.JFrame;
2
import javax.swing.JOptionPane;
3

    
4
/**
5
 In this example, hitting "Return" closes the window.
6
 Compile and run with:
7
 javac JOptionPaneTest.java
8
 java JOptionPaneTest
9
 */
10
public class JOptionPaneTest {
11
  public static void main(String[] args) {
12
    JFrame frame = new JFrame();
13
    Object result = JOptionPane.showInputDialog(frame, "What is the meaning of life?");
14
    System.out.println(result);
15
  }
16
}
(1-1/3)