When I ran this program:
import javax.swing.*;
import java.awt.*;
public class DrawApplet extends JApplet{
public void init () {
Container content_pane = getContentPane ();
// Create an instance of DrawingPanel
int x=1000, y=1000;
content_pane.setSize(x, y);
// And add the DrawingPanel to the content pane.
main_panel drawing_panel = new main_panel(x,y);
content_pane.add(drawing_panel);
}
}
it showed an error:
DrawApplet.java:16: error: cannot find symbol
main_panel drawing_panel = new main_panel(x,y);
^
symbol: class main_panel
location: class DrawApplet
DrawApplet.java:16: error: cannot find symbol
main_panel drawing_panel = new main_panel(x,y);
^
symbol: class main_panel
location: class DrawApplet
2 errors
Is
mya class you created? If so, it doesn’t follow typical naming standards – as classes should begin with a capital letter. Is it on the classpath?Furthermore, your error doesn’t match the code you’ve posted (
myvs.main_panel). Make sure your files and your build are up-to-date.