setParameter for Applet

Discussion in 'Java' started by ebramcity, Jul 16, 2005.

  1. ebramcity

    ebramcity Guest

    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 ?
     
    ebramcity, Jul 16, 2005
    #1
    1. Advertising

  2. On 16 Jul 2005 05:18:47 -0700, ebramcity wrote:

    > 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. ]

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    When You See The Robot, Drink!
     
    Andrew Thompson, Jul 16, 2005
    #2
    1. Advertising

  3. ebramcity

    ebramcity Guest

    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
     
    ebramcity, Jul 16, 2005
    #3
  4. On 16 Jul 2005 06:35:06 -0700, ebramcity wrote:

    > 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.

    --
    Andrew Thompson
    physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
    See You On Some Other Channel
     
    Andrew Thompson, Jul 16, 2005
    #4
  5. ebramcity

    ebramcity Guest

    any solution ?
     
    ebramcity, Jul 16, 2005
    #5
  6. ebramcity

    John English Guest

    ebramcity wrote:

    > any solution ?


    There is no solution. If you can load the applet, you can save it
    and dissect it at leisure.
     
    John English, Jul 17, 2005
    #6
  7. ebramcity

    Roedy Green Guest

    On 16 Jul 2005 05:18:47 -0700, "ebramcity" <> wrote
    or quoted :

    >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
     
    Roedy Green, Jul 17, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    applet vs. canvas in applet

    Rob Love, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    642
    Liu, Chunyen
    Jul 7, 2003
  2. webster
    Replies:
    0
    Views:
    877
    webster
    Jul 20, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    430
    Andrew Thompson
    Aug 5, 2003
  4. Piet71
    Replies:
    1
    Views:
    502
    Joe Kesselman
    Mar 7, 2007
  5. ignignokt

    SetParameter in JS

    ignignokt, Feb 4, 2007, in forum: Javascript
    Replies:
    0
    Views:
    114
    ignignokt
    Feb 4, 2007
Loading...

Share This Page