Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Using JOptionPane

Reply
Thread Tools

Using JOptionPane

 
 
jazzy
Guest
Posts: n/a
 
      04-18-2004
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);









}



}






 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
field name for jOptionPane when using Eclipse? ted holden Java 13 12-30-2004 07:58 PM
client socket hangs when using JOptionPane Eqbal Z Java 9 07-29-2004 06:10 PM
Using JOptionPane jazzy Javascript 0 04-19-2004 03:55 AM
Using JOptionPane jazzy Java 0 04-18-2004 05:59 AM
JOptionPane Cannot Override LookAndFeel's Font... SuperChuck Java 3 08-07-2003 03:33 PM



Advertisments