Applet programs do not work in my JCreator
Hi I fixed the path of Run Applet option in JDK Tools.
C:\Program Files\Java\jdk1.5.0_03\bin\appletviewer.exe
but when I compile my program it does not work I get this message on the screen.
Exception in thread "main" java.lang.NoSuchMethodError: main
why is that happening other main programs are working with no problem it just working with applets bring this message up.
Code:
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class WelcomeApplet extends JApplet
{
public void init(){}
public void paint(Graphics g)
{
super.paint(g);
int xPoints[] = {-10,0,10};
int yPoints[] = {0,-50,0};
Graphics2D g2d = (Graphics2D) g;
GeneralPath triangle = new GeneralPath();
triangle.moveTo(xPoints[0],yPoints[0]);
for (int k = 1; k<xPoints.length;k++)
triangle.lineTo(xPoints[k], yPoints[k]);
triangle.closePath();
g2d.translate(200,200);
g2d.setColor(Color.gray);
g2d.fill(triangle);
g2d.rotate(Math.PI/4.0);
g2d.fill(triangle);
g2d.rotate(Math.PI/4.0);
}
}
the code is right, it doesn't have a problem I guess.:rolleyes: