I'm reading a book titled '
Java - How to Program', by Dietel & Dietel. Great book! I have a question about some sample code.
In the book, this code snippet is supposed to popup a DialogBox, but I keep getting an error.
import javax.swing.JOptionPane;
public class Dialog1
{
public void main(
String[] args)
{
JOptionPane.showMessageDialog( null, "Welcome\nto\nJava" );
}
}
When I hit F6, I get an error message that says <no main classes found>. The Main Class is right there. I copied it right from the book. Why does it think the Main Class is not found and what do I need to do to make this work?
Thanks.