I wrote this from the example in the book.
import javax.swing.JOptionPane;
public class Greeter
{
public void sayHello()
{
JOptionPane.showMessageDialog(null, "Hello World","test", JOptionPane.INFORMATION_MESSAGE);
}
}
I then typed in the Terminal, javac Greeter.java the new command line popped up and I could see in the folder it created a file called Greeter.class
I then typed in, java Greeter
I was expecting a window to pop up sayign what it said in the book but here is what the termianl came back with.
larsg5s-power-mac-g5:~ larsg5$ java Greeter
Exception in thread "main" java.lang.NoSuchMethodError: main
larsg5s-power-mac-g5:~ larsg5$
I looked over the code and it looks ok, I think. The book didn't say to type this out I just tried it for fun, but I thought it would have worked.
Thanks,
-Lars
import javax.swing.JOptionPane;
public class Greeter
{
public void sayHello()
{
JOptionPane.showMessageDialog(null, "Hello World","test", JOptionPane.INFORMATION_MESSAGE);
}
}
I then typed in the Terminal, javac Greeter.java the new command line popped up and I could see in the folder it created a file called Greeter.class
I then typed in, java Greeter
I was expecting a window to pop up sayign what it said in the book but here is what the termianl came back with.
larsg5s-power-mac-g5:~ larsg5$ java Greeter
Exception in thread "main" java.lang.NoSuchMethodError: main
larsg5s-power-mac-g5:~ larsg5$
I looked over the code and it looks ok, I think. The book didn't say to type this out I just tried it for fun, but I thought it would have worked.
Thanks,
-Lars