Newb Question

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,315
Latest member
VernellPos

Latest Threads

Top