appletviewer

Okay... I am trying to use the applet viewer to look at my applets quicker but I keep getting this error: C:\Documents and Settings\Owner\My Documents\java>appletviewer mouse

I/O exceptionwhile reading: C:\Documents and Settings\Owner\My Documents\java\mouse (The system cannot find the

file specified)

But... I'm pretty sure I have the appletviewer in the same folder as javac. Help please?

[455 byte] By [Zacha] at [2007-11-27 4:28:38]
# 1
You have to specify the ".class" extension when using appletviewer.
Dalzhima at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 2
> You have to specify the ".class" extension when using> appletviewer.Just tried it... No errors, but the appletviewer screen doesn't come up. Do I have to do something to make it work besides just using the Command Prompt?
Zacha at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 3

Appletviewer operates on html; this is usually satisfied by executing an html file that invokes an applet, using the command "appletviewer <applet_name>.html"

It is also possible to include the needed html in the applet .java file, compile the applet, and execute it (without a separate html file) using the command "appletviewer <applet_name>.java". This requires the addition of a line similar to this to the applet's Java code:

/*<APPLET CODE="applet_name" WIDTH=150 HEIGHT=40></APPLET>*/

ChuckBinga at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 4

> Appletviewer operates on html; this is usually

> satisfied by executing an html file that invokes an

> applet, using the command "appletviewer

> <applet_name>.html"

>

> It is also possible to include the needed html in the

> applet .java file, compile the applet, and execute it

> (without a separate html file) using the command

> "appletviewer <applet_name>.java". This requires the

> addition of a line similar to this to the applet's

> Java code:

> /*<APPLET CODE="applet_name" WIDTH=150

> HEIGHT=40></APPLET>*/

Thanks for trying. It still does not work. I think it is trying to though... It's doing the same thing it's been doing.

Everytime I type in: appletviewer math.class

It acts like it worked but no screen pops up. I have the PATH set and everything, it's just not wanting to work. Help please.

Zacha at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 5
No, don't type in "mouse.class". Give it the name of an HTML file.
paulcwa at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 6
if the applet tag is already placed in your java file running this line will definetely work and there's no need to create the html file.appletviewer math.javanote that the java file has to be mentioned not the class file.
ArcherKinga at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 7

What happens is that the appletviewer scans the file you give it, looking for the <applet> HTML tag.It's not a full-fledged browser; it just knows how to look for applet tags. (So, for example, you can't pass it a file that uses javascript to create an applet tag.)

Once nice trick that people sometimes like to do, is to put the applet tags in a comment of their source code. That way, they reuse the java source as the target file for appletviewer. Personally, I prefer to keep a separate HTML file.

But either way, you DON'T pass appletviewer a class. Pass it something textual, with a correct <applet> tag in it.

paulcwa at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 8
Try appletviewer mouse.html
SysterTaraa at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...
# 9
Do this,1st compile usingjavac mouse.javaand then useappletviewer mouse.java
b.m.krajua at 2007-7-12 9:37:26 > top of Java-index,Java Essentials,New To Java...