469,612 Members | 1,592 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Using JOptionPane

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);



}

}


Jul 23 '05 #1
1 4358
jazzy wrote:
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:

<snip>

You'll probalby do better at comp.lang.java.programmer, this is a
javascript group.

Good Luck,
Mike

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by - Steve - | last post: by
1 post views Thread by Oleg Konovalov | last post: by
1 post views Thread by Smarteric | last post: by
5 posts views Thread by Ramola | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.