Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Passing parameters applet to applet

 
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 :-)
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Report post to moderator
Moved to the Applet forum.
 
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.
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic