permaculture playing cards*
The moose likes Beginning Java and the fly likes problem with applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem with applet" Watch "problem with applet" New topic
Author

problem with applet

Vids
Greenhorn

Joined: Oct 30, 2000
Posts: 8
I wrote a small applet program as follows:
import java.applet.*;
import java.awt.*;
public class FirstApplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("hello world",25,50);
}
}
It compiled fine. But when I run the program it gives the following error:
C:\jdk1.2.2\bin\java.exe
Working Directory - D:\shrividya\myprogs\
Class Path - C:\jdk1.2.2\lib\tools.jar;.;d:\kawa\kawaclasses.zip;c:\jdk1.2.2\jre\lib\rt.jar;c:\jdk1.2.2\jre\lib\i18n.jar
Usage: java.exe [-options] class [args...]
(to execute a class)
or java.exe -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-? -help print this help message
-X print help on non-standard options
Process Exit...
in the Kawa editor.
What should I do to resolve this error???
Thanks,
Vids
Prabhu Chandrasekaran
Ranch Hand

Joined: Oct 14, 2000
Posts: 36
Hi,
I think you are trying to execute an applet using java.exe which is used to execute applications written in java.
Try to execute the applet using an Applet Viewer or open it in a browser as part of a HTML file in the <applet> </applet> tags.
Reply back if this solves the problem.
Prabhu.V.C
Prabhu Chandrasekaran
Ranch Hand

Joined: Oct 14, 2000
Posts: 36
Hi,
I think you are trying to execute an applet using java.exe which is used to execute applications written in java.
Try to execute the applet using an Applet Viewer or open it in a browser as part of a HTML file in the "<applet> </applet>" tags.
Reply back if this solves the problem.
Prabhu.V.C
Vids
Greenhorn

Joined: Oct 30, 2000
Posts: 8
It was a small mistake in classpath. In customize-options of Kawa editor I had to give the path for Java lib Directory as "C:\jdk1.2.2\lib" for which I had given as "c:\jdk1.2.2\lib". After correction the problem is solved.
Thanks,
Vids
 
Don't get me started about those stupid light bulbs.
 
subject: problem with applet