AppletViewer not working
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
AppletViewer not working
When I try to run appletviewer I get this message:
I/O exception while reading: C:\Documents and Settings\Owner\Desktop\Dots.java (The filename, directory name, or volume label syntax is incorrect)
Does anyone know what the problem is?
also, what is the "Regular expression to match output" suppose to be configured to? This is under 'preferences' and 'tools'.
Thanks for the help!
I/O exception while reading: C:\Documents and Settings\Owner\Desktop\Dots.java (The filename, directory name, or volume label syntax is incorrect)
Does anyone know what the problem is?
also, what is the "Regular expression to match output" suppose to be configured to? This is under 'preferences' and 'tools'.
Thanks for the help!
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
The reg exp part is used to jump the offending line when you have errors in compilation.
This code, saved to c:\bfellows\test space\HelloWorld.java works a-ok when I compile and then hit run applet. Try that as an example to determine whether the issue lies within your code or the interaction of TP and Java.
And just to verify, the setting I have for the run applet tool are
command: appletviewer.exe
Parameters: $BaseName
Initial Folder: $FileDir
Reg Exp: ^.(\([^:]+\)([0-9]+\)
I may have misstyped the reg exp but I suspect a search through the forums would yield the correct one if I have erred.
Code: Select all
public class HelloWorld extends java.applet.Applet
{
public void paint(java.awt.Graphics g)
{
g.drawString("Hello World!", 50, 25);
System.out.println("Hello World");
}
}
And just to verify, the setting I have for the run applet tool are
command: appletviewer.exe
Parameters: $BaseName
Initial Folder: $FileDir
Reg Exp: ^.(\([^:]+\)([0-9]+\)
I may have misstyped the reg exp but I suspect a search through the forums would yield the correct one if I have erred.
I choose to fight with a sack of angry cats.
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
For me, it appeared to generate a page for it. Until I had tested it, I didn't think the setup in the tools menu would work but it will try and find an html doc in the current directory to execute against the class file and finding none, it appears to generate its own.
I choose to fight with a sack of angry cats.
Applet viewer not working
You might post your applet code so we can see what you're feeding the tool. Are you including the html browser markup within the comment at the top of the file (supply your own x and y values)?
/*
<applet CODE="file.class" width=x height=y>
</applet>
*/
This permits you to run the applet within the applet viewr.
I have received the error message you report with the "standalone" version of appletviewer because I did not include the file extension in the <applet CODE="FILE"> tag.However, TextPad would run it. It was not until I changed to CODE="file.class" within the tag that Sun's freestanding appletviewer would work.
/*
<applet CODE="file.class" width=x height=y>
</applet>
*/
This permits you to run the applet within the applet viewr.
I have received the error message you report with the "standalone" version of appletviewer because I did not include the file extension in the <applet CODE="FILE"> tag.However, TextPad would run it. It was not until I changed to CODE="file.class" within the tag that Sun's freestanding appletviewer would work.
Ok...
well, I tried that standard code and I still get the same error message
then, I tried the suggested preferences and I still get the same message..
(Let me ask you something, when you create HelloWorld.java, do you have to create a HelloWorld.html in the same folder?)
Unless I am making a stupid mistake, it's safe to assume that java and TP aren't interacting?
well, I tried that standard code and I still get the same error message
then, I tried the suggested preferences and I still get the same message..
(Let me ask you something, when you create HelloWorld.java, do you have to create a HelloWorld.html in the same folder?)
Unless I am making a stupid mistake, it's safe to assume that java and TP aren't interacting?
Appletviewer
To use the "Run Java Applet" tool inside of TextPad you do not have to have an HTML page with the <applet></applet> markup. You just need to have the markup within your java code (commented out, which will be skipped over by the compiler but read when the "browser" reads it ...
It sounds to me that your error message is indicating that the appletviewer is executing, but it doesn't know what the applet file is you want to run.
It sounds to me that your error message is indicating that the appletviewer is executing, but it doesn't know what the applet file is you want to run.
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
Re: Appletviewer
I respectfully disagree on that one. Using java 1.4.1_01, Textpad 4.7.1, I took the aforementioned HelloWorld applet code, used the compile tool in TP, then ran the applet tool via TP. TP generated a uniquely named html file that had enough html in there to call our applet. In the case where there is more than one html file out there, a dialog box pops up asking you which html file you'd like to use or the selection of the the No option will have TP make a new one for a given .classnspils wrote:To use the "Run Java Applet" tool inside of TextPad you do not have to have an HTML page with the <applet></applet> markup. You just need to have the markup within your java code (commented out, which will be skipped over by the compiler but read when the "browser" reads it ...
Vasastrae, I've put a jar (zip) file out here which contains the .java, .class and .html file. Extract the contents to a directory and I would take an iterative approach to resolve this issue.
Step 1 would be to invoke the appletviewer from the command line
i.e. C:\> c:\j2sdk1.4.1_01\bin\appletviewer.exe "\Documents and Settings\Owner\Desktop\HelloWorld.html"
If that works, then try opening the java file in TP and then run the applet tool and see what happens.
I choose to fight with a sack of angry cats.