JOptionPane does not execute here--Why? [message #780932] |
Fri, 20 January 2012 00:20 |
l m Messages: 4 Registered: January 2012 |
Junior Member |
|
|
Hi--I am running this program in Eclipse/helios and after I enter the word in the console the msg dialog box does not open. I run the Strings class via cmd and the dialog box opens properly.
import javax.swing.JOptionPane;
import java.util.Scanner;
public class Strings {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter a word...");
String s1 = input.next();
System.out.println("s1 is " + s1);
String message = "Java is fun";
JOptionPane.showMessageDialog(null, message);
}
}
[Updated on: Fri, 20 January 2012 00:21] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05495 seconds