Can't read file when called from Applet?
From: Kalid (stopstaring_at_boobs.com)
Date: 06/29/04
- Next message: Roedy Green: "Re: Can't read file when called from Applet?"
- Previous message: Roedy Green: "Re: Advice for refactoring"
- Next in thread: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Nigel Wade: "Re: Can't read file when called from Applet?"
- Reply: FISH: "Re: Can't read file when called from Applet?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Jun 2004 19:14:52 -0500
When I run this code in the applet all I get back is the default string
("x") I have the syllable initialized to (ie. the result is "x", "xx",
"xxx", etc..., depending on what value a is), suggesting it's not reading
from the text files located in the same directory.
[...]
int a = Integer.parseInt(s);
SyllableGenerator sg = new SyllableGenerator();
String name = new String("");
for (int i=0; i<a; i++)
name = name+sg.getSyllable();
output.setText(name);
[...]
However when I run it in a Tester class from the command line, it works
fine.
[...]
SyllableGenerator sg = new SyllableGenerator();
int a = 3;
String name = new String("");
for (int i=0; i<a; i++)
name = name+sg.getSyllable();
System.out.println("The name is: "+name);
[...]
What do I need to do differently? Thanks in advance for any help.
- Next message: Roedy Green: "Re: Can't read file when called from Applet?"
- Previous message: Roedy Green: "Re: Advice for refactoring"
- Next in thread: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Roedy Green: "Re: Can't read file when called from Applet?"
- Reply: Nigel Wade: "Re: Can't read file when called from Applet?"
- Reply: FISH: "Re: Can't read file when called from Applet?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|