Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

setParameter for Applet

Thread view: 
ebramcity - 16 Jul 2005 13:18 GMT
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 ?
Andrew Thompson - 16 Jul 2005 14:14 GMT
> 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. ]

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
When You See The Robot, Drink!

ebramcity - 16 Jul 2005 14:35 GMT
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
Andrew Thompson - 16 Jul 2005 15:03 GMT
> 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.

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
See You On Some Other Channel

ebramcity - 16 Jul 2005 15:06 GMT
any solution ?
John English - 17 Jul 2005 04:27 GMT
> any solution ?

There is no solution. If you can load the applet, you can save it
and dissect it at leisure.
Roedy Green - 17 Jul 2005 08:45 GMT
>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();
              }
        }
        }

Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.