D
Dagorlas
Im learning java, and i build a simple applet...
I compiled it into *.class and now, when i run it, i got the following
error:
Exception in thread "main" java.lang.NoSuchMethodError: main
How can i fix this? the code of the applet is this:
import java.awt.*;
public class RootApplet extends javax.swing.JApplet {
int number;
public void init() {
number = 225;
}
public void paint(Graphics screen) {
Graphics2D screen2D = (Graphics2D) screen;
screen2D.drawString("the square root of " +
number +
" is " +
Math.sqrt(number), 5, 50);
}
}
I hope some1 can help me
I compiled it into *.class and now, when i run it, i got the following
error:
Exception in thread "main" java.lang.NoSuchMethodError: main
How can i fix this? the code of the applet is this:
import java.awt.*;
public class RootApplet extends javax.swing.JApplet {
int number;
public void init() {
number = 225;
}
public void paint(Graphics screen) {
Graphics2D screen2D = (Graphics2D) screen;
screen2D.drawString("the square root of " +
number +
" is " +
Math.sqrt(number), 5, 50);
}
}
I hope some1 can help me