setParameter for Applet

E

ebramcity

Hi All
I want to set parameters of an applet (Applet2) and I don't want to use
HTML tags to do this. I want to load "Applet2" from "Applet1" and
everything is Ok but I can't find a way to pass parameters from Applet1
code to Applet2. If there were a setParameter(key,val) htere was no
problem ....
Can anybody help me please ?
 
A

Andrew Thompson

Hi All
I want to set parameters of an applet
URL?

..(Applet2) and I don't want to use
HTML tags to do this.

Why not? What have you got against HTML?
..I want to load "Applet2" from "Applet1"

In the same web page?

In different frames of the same web page?

In different browsers - coming off different sites -
displayed on different computers?
..and
everything is Ok but I can't find a way to pass parameters from Applet1
code to Applet2.

Have you checked the API docs? They are often helpful
in circumstances such as this.
..If there were a setParameter(key,val) htere was no
problem ....
Can anybody help me please ?

Possibly.. that depends on you and how hard
you are prepared to work.

[ Of course, anybody else can feel free to jump in and
help you here - but if it is me - ..you have a lot of work
ahead of you. And you'll need to direct your questions to
c.l.j.help. ]
 
E

ebramcity

HI dear Andrew
I work for a company and this company has applets written before and
dont want others to download this .class files and work offline with
them.
My task is writing an applet that can load those applets . because of
this security restrictions I cant easily load the HTML files of main
applets ( using getAppletContext().showDocument(URL) ) because popel
can download main classes from source of their HTMLs this way....

I used this code to do this :

Applet app = (Applet) Class.forName("mainClass").newInstance();
add(app);
app.setStub(this);
app.resize(getWidth(),getHeight());
app.init();
app.start();

It works fine for applets that haven't parameters
My problem is extending this code to set parameters from my applet code
for main applets
Thank U a lot 4 Ur attention
 
A

Andrew Thompson

I work for a company and this company has applets written before and
dont want others to download this .class files and work offline with
them.

Good luck with it.
 
R

Roedy Green

I want to set parameters of an applet (Applet2) and I don't want to use
HTML tags to do this. I want to load "Applet2" from "Applet1" and
everything is Ok but I can't find a way to pass parameters from Applet1
code to Applet2. If there were a setParameter(key,val) htere was no
problem ....
Can anybody help me please ?

If both applet are willing to co-operate, applet A can call methods of
Applet B once it finds it.

It can find it either by doing a new SomeOtherApplet or if it already
running somewhere else on the page you write code like this which
comes from CurrCon. The applets share information about what currency
the user likes and all update to his latest choice.

for ( Enumeration other=getAppletContext().getApplets();
other.hasMoreElements(); )
{
Object otherApplet = other.nextElement();
{ if ( otherApplet instanceof CurrCon )
{
CurrCon otherCurrConApplet = (CurrCon) otherApplet;
// I suspect Applets will be on this list that have not
finished
// executing init.
otherCurrConApplet.currencyChangeListener();
}
}
}

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top