Using JOptionPane

Discussion in 'Java' started by jazzy, Apr 18, 2004.

  1. jazzy

    jazzy Guest

    Hi,

    I am new to Java Programming and I am trying to write code using JOption
    pane to prompt user to type information and then have string output command
    to display information on the screen.
    I am able to prompt for typing the information but the display does not
    work. Here is my sample code:

    **

    /**

    * <p>TitleTesting</p>

    * <p>Descriptio: Display Movie list</p>

    *

    */

    //Print Address Labels

    import javax.swing.JOptionPane;



    public class Homework1 {

    public Homework1() {



    }

    public static void main(String[] args) {

    String movieName;

    String theaterName;





    //Enter Movie Name

    String movieName =

    JOptionPane.showInputDialog(

    null, "Enter the Name of the Movie ",

    "Example 1.0 Input",

    JOptionPane.QUESTION_MESSAGE);

    //Enter Name

    String directorName=

    JOptionPane.showInputDialog(

    null, "Enter Name of Director ",

    "Example 1.1 Input",

    JOptionPane.QUESTION_MESSAGE);

    //Display Name of Movie and Director



    String output = movieName+ directorName

    JOptionPane.showMessageDialog(null,output,"Example 1.2 output",

    JOptionPane.INFORMATION_MESSAGE);

    System.exit(0);









    }



    }
     
    jazzy, Apr 18, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SuperChuck
    Replies:
    3
    Views:
    4,276
    Sandip Chitale
    Aug 7, 2003
  2. Joseph M. DeAngelo
    Replies:
    0
    Views:
    1,244
    Joseph M. DeAngelo
    Nov 9, 2003
  3. Alex Hunsley

    thread safeness of JOptionPane et al

    Alex Hunsley, Jan 13, 2004, in forum: Java
    Replies:
    0
    Views:
    863
    Alex Hunsley
    Jan 13, 2004
  4. jazzy

    Using JOptionPane

    jazzy, Apr 18, 2004, in forum: Java
    Replies:
    0
    Views:
    670
    jazzy
    Apr 18, 2004
  5. nick yakman

    JOptionPane awt version

    nick yakman, Apr 21, 2004, in forum: Java
    Replies:
    2
    Views:
    2,480
    Andrew Thompson
    Apr 22, 2004
  6. Eqbal Z
    Replies:
    9
    Views:
    3,129
    Carl Howells
    Jul 29, 2004
  7. ted holden
    Replies:
    13
    Views:
    937
    ByteCoder
    Dec 30, 2004
  8. jazzy

    Using JOptionPane

    jazzy, Apr 19, 2004, in forum: Javascript
    Replies:
    0
    Views:
    219
    jazzy
    Apr 19, 2004
Loading...