Can't read file when called from Applet?

From: Kalid (stopstaring_at_boobs.com)
Date: 06/29/04


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.



Relevant Pages

  • Re: Newbie Problem using if statement with &&
    ... >> John wrote: ... >>> string of 1 or 0 depending on what im sending. ...  > Yeah I have tested the vslues and they are valid. ...
    (comp.lang.php)
  • RE: Function Trouble
    ... My old HEIGHT function was wrong, and your suggesting Variant over STRING made a difference in the long run. ... Thanks again, Chris! ...
    (microsoft.public.access.modulesdaovba)
  • Re: Newbie Problem using if statement with &&
    ... Jerry Stuckle ... JDS Computer Training Corp. ... > string of 1 or 0 depending on what im sending. ...
    (comp.lang.php)
  • Re: Extract data from String
    ... I need to split this data out into separate columns. ... a random length depending on the data in it. ... string as it is, the following one shows how it should be split up into ... The same functions can be run from within VBA using the RUN ...
    (microsoft.public.excel.programming)
  • Re: Extract data from String
    ... Dim arrSegments, iLastSegment as integer ... I need to split this data out into separate columns. ... a random length depending on the data in it. ... string as it is, the following one shows how it should be split up into ...
    (microsoft.public.excel.programming)