passing arguments to applet

Discussion in 'Java' started by Georg Andersson, May 25, 2004.

  1. hi

    is there a way to pass arguments to an applet?

    regards
     
    Georg Andersson, May 25, 2004
    #1
    1. Advertisements

  2. Georg Andersson

    Murray Guest

    Yes there is.

    e.g.
    <applet code="YourApplet.class" width="700" height="300">
    <param name="someParam" value="someValue"/>
    <param name="anotherParam" value="anotherValue"/>
    ... etc.

    Then in your code
    String someParam = getParameter("someParam");
    String anotherParam = getParameter("anotherParam");
    ... etc.
     
    Murray, May 25, 2004
    #2
    1. Advertisements

  3. Georg Andersson

    Roedy Green Guest

    Roedy Green, May 25, 2004
    #3
  4. Sure, use the <PARAM> tag inside the <APPLET> tag.
     
    Michael Borgwardt, May 25, 2004
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.