|
|
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);
}
}
|
|
0
|
|
|
|
Reply
|
jazzy
|
4/19/2004 3:55:48 AM |
|
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
|
|
0
|
|
|
|
Reply
|
mscir
|
4/19/2004 4:05:17 AM
|
|
|
1 Replies
552 Views
(page loaded in 0.45 seconds)
Similiar Articles: Using JOptionPane Follow - Computer GroupHi, 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 comm... Problem in Full screen mode(while showing Joptionpane message ...On 25 Jul 2003 06:02:27 -0700, hi_asit@rediffmail.com (Asit) wrote or quoted : > it hangs and dialog goes below the main frame. By this you mean the app freezes and ... JOptionPane behind the Window which is set to be always on top ...On Sun, 18 Sep 2005 11:09:22 +0530, "Sameer" <spamtoobad-sameer@yahoo.com> wrote or quoted : >What I have to do diplay a JOptionPane dialog on top of another Window ... Enable/disable JOptionPane button - comp.lang.java.guiI create a dialog using a JOptionPane: Object options[] = {"OK", "Apply", "Cancel"}; wOptionPane = new JOptionPane( child, messageType, ... Simple error : method format(String, Object[]) is not applicable ...Hi all,I am a java newbie and I am using eclipse to write this simple code: // Fig ... import javax.swing.JOptionPane; // import class JOptionPane public class DialogBox ... Background image in JOptionPane kow to? - comp.lang.java ...Hi experts! Is it possible to set background image in JOptionPane.showConfirmDialog ? Googling left and right brought me non- working solutions only... How to handle the Cancel button on JOptionPane.showInputDialog ...How to set default button to "Cancel" when using window.confirm ... How to handle the Cancel button on JOptionPane.showInputDialog ... How to handle the Cancel ... the ... How to set default button to "Cancel" when using window.confirm ...Using JOptionPane - comp.lang.javascript JOptionPane behind the Window which is set to be ... Then I tried a dialog to confirm if this ... contenteditable divs and setting ... Value list validation error - comp.databases.filemakerUsing JOptionPane - comp.lang.javascript Value list validation error - comp.databases.filemaker JOptionPane.ERROR_MESSAGE, null ... makes it easy to pop up a standard ... contenteditable divs and setting the cursor position - comp.lang ...Hi, I am creating a WYSIWYG designer using 'contenteditable' div's. Does ... Using JOptionPane - comp.lang.javascript How to kill the ginput cursor - comp.soft-sys ... JOptionPane (Java 2 Platform SE v1.4.2)public class JOptionPane extends JComponent implements Accessible. JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs ... How to Make Dialogs (The Java™ Tutorials > Creating a GUI With ...The rest of this section covers the following topics: An Overview of Dialogs; The DialogDemo Example; JOptionPane Features; Creating and Showing Simple Dialogs 7/23/2012 12:04:11 PM
|
|
|
|
|
|
|
|
|