Dear Friends,
Here i am giving my programme coding and error.
file name - MyCanvas.javaimport java.awt.*;
import java.applet.*;
public class MyCanvas extends Applet {
public MyCanvas() {
setSize(80, 40);
}
public void paint(Graphics g) {
g.drawRect(0, 0, 90, 50);
g.drawString("A Canvas", 15,15);
}
}
When i use command javac MyCanvas.java it is compile but when i use appletviewer
then it shows following error.
E:\pardeep\java\JAVAPROGRAMMES>javac MyCanvas.java
E:\pardeep\java\JAVAPROGRAMMES>appletviewer
Usage: appletviewer <options> url(s)
where <options> include:
-debug Start the applet viewer in the Java debugger
-encoding <encoding> Specify character encoding used by HTML files
-J<runtime flag> Pass argument to the java interpreter
The -J option is non-standard and subject to change without notice.
E:\pardeep\java\JAVAPROGRAMMES>
Please help i am new to java but i know c/c++ very well.