Pass arguments in a applet

i know when you run a prog you could pass arguments, can i do with my applet.. like take a textbox in my html page?????

thx man you're nice
yes. you can do that. That is actually an <HTML>
syntax question. Following might help
<applet code="Chat" width=600 height=400>
<param name=host value="somewhere.hotwired.com">
<param name=port value="2323">and on the java side look at the APi and under Applet
class look for getParameter() method

Similar Messages

  • How to pass argument to the Java Plugin JVM w/o using the Control Panel?

    I want to deploy an applet to be loaded by the Java Plug In
    and fix some settings of its Java Virtual Machine.
    The JPI Control Panel offers two ways to pass arguments to the JVM,
    none satisfactory.
    1. while interactive via the Control Panel Window.
    This cannot be a solution for a deployed applet.
    or
    2. by editing the system generated file that stores
    the settings of the Plugin Control Panel, using a property
    named javaplugin.jre.params.
    The problem with this method is that if forces to access
    and edit this property file which is stored at various locations
    depending the client platform. Then, it may collide with other
    settings for other applets.
    Is there a way to pass the arguments to the JVM
    from within the html file?
    Has anyone found a solution to this question?
    JPS

    I am interested in this issue as well.
    Did anyone find a reliable way to specify the runtime parameters that should be used by the Java Plug-in in order to execute a given Java applet?
    I believe a good place to specify these runtime parameters would be the applet's JAR manifest: only digitally signed applets should be able to set the desired runtime parameters...
    Any comments / suggestion would be greatly appreciated.
    Regards,
    Marco.

  • Passing parameters to an applet

    Hello,
    I'm developing a set of services supported by CORBA; the services are all done and tested OK with a command-line client. However, the final client will be an applet and I'm having trouble starting it. The command-line client was started with a command-line argument like "java -Xbootclasspath/p:/usr/share/java/JOB/OB.jar myApp" and it's lacking is causing problems whilst starting the applet. How do I pass this argument to the applet? Is it possible to set it via System.getProperties().put(...) ?
    Thanks in advance! :)

    Hi,
    search the web by google for passing parameter to java applet. These words gave me a lot of links related to this topic.
    L.P.

  • Can we pass arguments to JNLP?

    I am new to JNLP and want to know can we pass arguments to JNLP?
    If yes where I can find the info abt it?

    Dolda2000 wrote:
    Will that really work well, though? As far as I can tell, the JNLP client will try to refetch the JNLP file when launching the Java program (reasonable enough). If I were to include
    information from that is only available via the user's web brower's session, I would not be able to recreate that data when the JNLP client tried to refetch the JNLP file.If you're worried about that why not use a user specific cookie?
    Your CGI script can check for/generate/pass one along with the XML stub.
    As far as I know the JNLP is stateless. It loads once,
    the information is cached, your application gets run....
    I already do this with <applet> tags (not currently JNLP) to identify returning users
    and pass dynamic parameters to applets. I will be updating to JNLP after a rewrite
    of some code.
    P

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • How to pass argument in manifest file

    Hi,
    I want to pass argument to main class in jar. Is there any option in manifest file.

    Hmm..
    Seems that my sentence above isn't so correct.
    It possible to add custom attribute: value pairs into manifest file and
    read it later from Java class.
    Here is code sample:
    public class ManifestTest {
        public static void main(String[] args) {
            try {
                java.util.jar.JarFile jar = new java.util.jar.JarFile(System.getProperty("java.class.path"));
                for (java.util.Iterator it = jar.getManifest().getMainAttributes().keySet().iterator();it.hasNext();) {
                    Object curKey = it.next();
                    System.out.println("key: " + curKey + ", value: " + jar.getManifest().getMainAttributes().get(curKey));
            } catch (Throwable t) {
                System.out.println("exception occured: " + t);
    }

  • How can I pass arguments to a TestStand sequence with LabWindows 6 ?

    Hi
    I have created sequences in a TestStand file.
    I want to program a sequence with Labwindows 6 which would call all these existing sequences (containing parameters).
    I don't have any problems to create the steps "SequenceCall" but i don't know how to pass arguments to the sequences with the TS API.
    I have used the look-up strings "TS.SData.SFPath", "TS.SData.SeqName", "TS.SData.ThreadOpt" to program the sequence file / sequence and the multithread option. But now how to program the arguments passing ? I think there is something with the lookup string "ST.SData.ActualArgs"...
    Thank u very much for any help

    I'm not sure if you want to pass values from TestStand to LabWindows or if you want to pass values in TestStand from a sequence call step to a called sequence.
    To get TestStand variables from LabWIndows, use the following function:
    tsErrChk (TS_PropertyGetValNumber(testData->seqContextCVI, &errorInfo, "Locals.StartPoint", 0, &dStartPt));
    iStartPt = (int)dStartPt;
    The TS_PropertyGetValNumber gets the TestStand variable Locals.StartPoint and puts it into the LabWindows variable called dStartPoint. Numbers to and from Test Stand are always a double type. The next line converts it to an integer.
    To put a LabWindows value to TestStand, use TS_PropertyPutValNumber.
    To pass values from a sequence call step to a called sequence, create variables in the Parameters t
    ab on your main sequence. Create same variables on the Parameters tab of the called sequence. In main, specify module to be called in calling step. There is a paramters section on the Edit Sequence Call dialog box which appears. Check the Use Prototype of the Selected Sequence box. You can then list all the parameter variables in the parameters section.
    Hope this is what you want.
    - tbob
    Inventor of the WORM Global

  • Passing Arguments in a Multiple JFrame project

    I am trying to pass Arguments from MainApp.java to SubApp.java.
    Is there someone that have an example or fix the sample program included?
    tks a lot
    sage49
    I based my program on the following 2 programs that I got from this forum!!
    The following is the MainApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class MainApp extends JFrame {
        MainApp() {
            super( "Main Application" );
            JButton button = new JButton( "Show Sub Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
    //  need to pass a string to SubApp in the following line
                    JFrame app = new SubApp();
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            MainApp app = new MainApp();
    }The following is the SubApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class SubApp extends JFrame {
    // need to accept a String as Arguments
        SubApp() {
            super( "Another Application" );
            JButton button = new JButton( "Show Main Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new MainApp();
                    dispose();
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            SubApp app = new SubApp();
    }

    Hi,
    I have done what you suggested, Now I get an error on the subApp on the main.
    see What I tried in the code.
    MainApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class MainApp extends JFrame {
        MainApp() {
            super( "Main Application" );
            final String a ="this is the string";
            JButton button = new JButton( "Show Sub Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new SubApp(a);
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            MainApp app = new MainApp();
    }The SubApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class SubApp extends JFrame {
            private String mystring;
            SubApp(String mystring) {   
            super( "Another Application" );
            this.mystring = mystring;
            JButton button = new JButton( "Show Main Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new MainApp();
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
           // tried    =    SubApp app = new SubApp(mystring);
           // tried    =    SubApp app = new SubApp(a);
           // tried    =    SubApp app = new SubApp(String a);  
           // tried    =    SubApp app = new SubApp(String);                 
            SubApp app = new SubApp();                // this is the line I get the error
    }I get the following error:
    Cannot find Symbol
    symbol  : constructor SubApp()
    location: class SubApp
            SubApp app = new SubApp();Tks a lot
    sage49

  • Passing parameter between two applets

    hi all,
    i want to pass parameter between two applets. in other words, when user clicks the button; close the running applet, pass parameter to another applet and run another applet.
    now i think that could be, ( creating a parameter table in database, when user click on button write parameters to table and stop active applet and run other applet. when other applet runs in init methot it takes parameter from table). but it will be very indirect way.
    if you have an idea or information, plesae tell me.
    thanks for your interest

    Hi ,
    Plz pay a visit to this wonderful website,
    http://www.rgagnon.com/javadetails/java-0022.html / http://www.rgagnon.com/howto.html
    Best Wishes,
    Gaurav
    PS : Thanks to Real Gagnon. This is all I can do at this stage, but wanted to say you are doing a wonderful job.

  • Creating pocess intance of a different process and passing arguments

    Creating Process instance of a different process:
    I have two different process: Main_Flow (id: MainFlow) and Second_Flow (id: SecondFlow). In the first process I am reading a csv file. Each line of the file has four columns. After reading each line I have to initiate Second_Flow and pass the read data from the file. (Pls find the code below for the whole process):
         fileReader = FileReader(arg1 : fullFileName);//filename is of file type and have file name and path
         Java.Io.BufferedReader reader = BufferedReader(arg1 : fileReader);
         String str;
         int countLines = 0;
         while ((str = reader.readLine()) != null)
              strColumn = str.split(delim : ",");
                   int ColumnCnt = 0;
                   while (ColumnCnt < 4)
                        //defining variables
                        String appNo;
                        String custNo;
                        String loanAmm;
                        String loanDate;
                        //logMessage("Value at Column: " + ColumnCnt + " is " + strColumn[ColumnCnt]);
                        if (ColumnCnt == 0)
                             arrLoanData["appNo"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 1)
                             arrLoanData["custNo"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 2)
                             arrLoanData["loanAmm"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 3)
                             arrLoanData["loanDate"] = strColumn[ColumnCnt];
                        arrLoanData["descriptionArg"] = "AutoInstance: " + formatTime('now', timeStyle : Time.SHORT);
                        arrLoanData["genByArg"] = "Automatic";
                        ProcessInstance.create(processId : "/SecondFlow", arguments : arrLoanData, argumentsSetName : "BeginIn");
                        ColumnCnt = ColumnCnt + 1;
              countLines = countLines + 1;     
    (“The code is in Java and not in PBL”)
    I have to pass appNo, custNo, loanAmm and loanDate as the arguments. The Argument will be of Any[String] type. The argument set name of Second_Flow is “BeginIn”. But I am not getting anything in Second_Flow.
    What can I do in the argument mapping of begin of Second_Flow to get the passed argument (array)?

    the argument 'arguments' for the method ProcessInstance.create receives a map of the arguments that the 'argumentSetName' argument set will receive.
    so for example if your second flow has 2 arguments, String name, Decimal value and String[] content your method invocation would be:
    ProcessInstance.create(processId : "/SecondFlow", arguments : {"name": strNameFromCsv, "value": valueFromCsv, "content": ["a","b","c","d"]}, argumentsSetName : "BeginIn");

  • How to pass argument in main function ?

    How to pass arguments in main function of one class from another class ?
    I don't want to pass argument from command prompt.
    I want to try something like this -
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
         System.out.println(args);
    class Fun{
    public static void main(String args[]){
         Test t=new Test("Hello","good bye");
    when i run Fun class it gives error.
    Suggest me how can i do that.

    In Fun class main method does not take arguments that is fine. In Test class instead of main method you can have constructor to take input parameters as suggested by BalusC
    However, if you want to make your existing code work, you can call (though not appropriate) main() method of Test class from main() method of Fun class (As main() method is static object is not required to invoke this):
    Test.main(new String[]{"Hello","good bye"});Here is your code:
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
    System.out.println(args);
    public class Fun{
    public static void main(String args[]){
    //Test t=new Test("Hello","good bye");
    Test.main(new String[]{"Hello","good bye"});
    } Thanks,
    Mrityunjoy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Passing parameters from an applet to a URL

    I need to pass information from an applet to an html page or JSP page, is this possible? Thanks.

    Yes you can!
    The following code might works (with some modifications ;)):
    AppletContext context = this.getAppletContext();
    URL url = new URL("http://host:port/path?parameter=value");
    context.showDocument(url, "windowName");In addiction, consider java.net.URLEncoder.encode() method to encode properly your parameters.
    Regards
    Paolo

  • Issue with passing parameters to an applet?

    Hi,
    I have an apex page which is a popup page. I am passing parameters to the applet and then reading them in from my java code.
    Here is my applet code
    <SCRIPT>
      function getStatus(retStatus) {
        $s("P3_MESSAGE", ''||retStatus||'')
    </SCRIPT>
    <APPLET ARCHIVE="/i/bin/offline_load.zip" CODE="offline_load.class"  STATUSMSG WIDTH=0 HEIGHT=0>
    <PARAM name="username" value="&APP_USER.">
    <PARAM name="dbuser" value="&P3_DBUSER.">
    <PARAM name="dbpassword" value="&P3_DBPASSWORD.">
    <PARAM name="dbserver" value="&P0_DBSERVER.">
    <PARAM name="dbport" value="&P3_DBPORT.">
    <PARAM name="dbsid" value="&P3_DBSID.">
    </APPLET>P3_DBUSER, P3_DBPASSWORD, etc are all defined on page zero as hidden and protected items
    My applet code
    public void init() {
        CallableStatement load_stmt = null;
        String userName = this.getParameter("username");
        String dbUser = this.getParameter("dbuser");
        String dbPass = this.getParameter("dbpassword");
        String dbServer = this.getParameter("dbserver");
        String dbPort = this.getParameter("dbport");
        String dbSid = this.getParameter("dbsid");
        try {
          System.out.println("init(): loading OracleDriver for applet created at " + created.toString());
          Class.forName("oracle.jdbc.driver.OracleDriver");
          System.out.println("init(): getting connection");
          conn = DriverManager.getConnection("jdbc:oracle:thin:@" + dbServer + ":" + dbPort + ":" + dbSid, dbUser, dbPass);
        } // end tryThe odd thing is I have gotten this working twice then unexpectedly it just stops working when I make a change to the java applet code.
    And the changes have absolutely nothing to do with the above code it can be anything the first time was error handling I added
    to another section and the second I modified a stored procedure call.
    Anyone have any idea why this might be occurring as this is driving me completely insane :(
    Thanks in advance

    Hi,
    In your init() code, you have a "try" block - do you have a "finally" block to close the connection? Something like:
    finally {
      try {
        conn.close();
      catch (Exception ignore) {
    }Could it be that you have reached the limit of the number of available open connections?
    Your code looks ok as far as I can see (based on examples at: http://www.orafaq.com/wiki/JDBC )
    Also, in your new bits of code, have you added try/catch/finally blocks? Does the code compile fully (ie, no warnings)? Have you added new imports that may conflict with existing code such that you have to fully qualify existing objects/classes (eg, you may now have two DriverManager classes or CallableStatement objects)?
    Andy

  • Passing parameters to an applet dynamically

    I am looking for suggestions on how I can pass parameters to my applet which generates a simple bar graph. If I pass parameter names and values using HTML tags the number of bars are fixed. I want my applet to accept variable number of values for the x and y axes.

    Then use a JSP for the HTML page. This can then pass dynamically generated numbers as params. Alternatively, your applet could communicate to the server through a Socket (package java.net) - although this can cause problems if there are firewalls inbetween client and server.

  • Passing parameters to my applet on apex

    i cannot seem to pass parameters to my applet which i embedded on my apex region. can anyone help.

    We probably can't help without more information, details and perhaps and example to look at.

Maybe you are looking for

  • Can I connect my iPod to my stero surround sound?

    Can someone tell me how to connect my iPod to my stero surround system if it's possible. Do I need to buy a cable, if so, what?

  • Long sync damaging my iPad?

    I've had troubles syncing my iPad to my XP comp since the beginning, but lately he seems to have taken the tendency to take hours to preform the first step of the sync. There are anywhere between 3 and 6 steps when I sync up (depending on what I've a

  • FINAL CUT EXPRESS UPGRADE SERIAL NUMBER PROBLEMS

    they ask me to type in my "original serial number" i do, cuz i just got the upgrade...but when i type in the number it says that the "serial number upgrade" so what's the original, how do i get, i only have the upgrade, did they give me the wrong CD?

  • How buy at att on line or store?

    if i will buy some iphones at store or online.. they forced me to make a contract ? i need some for gift... but i buy 2 before to apple store with my card... att can sold if you buy before ??

  • FRM-30087

    Hi,friends on Oracle I always get the error hint: FRM-30087: Unable to create form file when I CTRL+R. I have checked the online help ,it told me: Cause:  You lack privileges in the specified directory, or you do not have the disk space required. Act