Bookmark Topic Watch Topic
  • New Topic

Passing parameters applet to applet  RSS feed

 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi.
I have three applets, one calls the second, second the third.
The third applet, ExplanatoryText.java, receives a parameter of type String.
Based on value of this parameter, ExplanatoryText creates a pop-up JFrame and displays the explanatory html file.
I've following compile-time error.
Now I know init() in ExplanatoryText.java is not a class, but if I use a class to receive parameters, I cannot init getCodeBase().
How does one work around this problem?

cannot resolve symbol
constructor ExplanatoryText (java.lang.String, java.lang.String)
class ExplanatoryText
......{xplnTxt = new ExplanatoryText("ShortDescription", "About Forest Fire");}
..................^

Obviously it doesn't like the way I'm passing the string parameters.
Can someone please spot where I might have gone wrong?

Following is the code for ExplanatoryText.java
It uses the parameter fileName as a handle and headerTxt to build the JFrame header.
On itself, it works as expected.

TIA :-)
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Report post to moderator
Moved to the Applet forum.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is a duplicate of an existing thread. Please don't post the same message more than once. This thread is now closed.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!