OK !
So the MainFrame is only needed if the applet is run as an application. If it's run as
an applet first is called the constructor, and afterwards the init() method.
I think the best solution for catching the parameters is building the scene graph from
the init() method, instead of building it from the applet constructor.
Am I right ?
Many thanks !!
Dani
An applet has four important methods, init(),start(),stop(), and destroy().
These methods are *called* by the browser the applet is embedded in. The
browser *never* calls the main() method.
If you are running the applet from a browser or the appletviewer, use the
init() method to create the MainFrame. You could even have the init() method
call the main() method of your applet.
If you are running the applet from the command line using
java MyApplet
any parameters you have embedded in the HTML will *not* be read. You need
to pass the parameters explicity with
java MyApplet parameter1 parameter2
----- Original Message -----
From: "Theron, Jannie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 5:46 AM
Subject: Re: [JAVA3D] Applet parameters
The main method is called when you run the applet as an application from the
command line. It doesn't even know about the html with the parameter values.
Look at the SphereMotion example on how to get values from the command line
into the mai method.
-----Original Message-----
From: Daniel Moscoso [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 2:44 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Applet parameters
The problem is that I cannot get the parameter values in the main() method,
and I need the values here, because
new MainFrame(new HelloUniverse(), 100, 100) is called from main(), which
is executed before init().
Should I have to run the applet without using the MainFrame class ?
Many thanks !!
Dani
Why don't you pass command line parameters in the main method when running
the applet as an application(which is what the main method is for) and use
the init getparameters for when running in browser ?
Jannie
-----Original Message-----
From: Daniel Moscoso [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 11:39 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Applet parameters
Hi all !!
I know that parameters can be passed to an applet from the HTML file with
<PARAM name=paramName value=paramValue>. But the parameter values can be
caught with getParameter(...) only in the init() method of the applet.
The applets usually written in java3d have the main() method and construct
the applet with new MainFrame(new HelloUniverse(), 100, 100), for example.
But the method getParameter() cannot be used or returns null if it's not
called from init() applet method.
Does anyone know a way to catch this parameters ? Has the applet to be used
in another way ?
Thanks in advanced !!
Dani
--
Diese E-Mail enth�lt vertrauliche und/oder rechtlich gesch�tzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrt�mlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
--
Diese E-Mail enth�lt vertrauliche und/oder rechtlich gesch�tzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrt�mlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
--
Diese E-Mail enth�lt vertrauliche und/oder rechtlich gesch�tzte Informationen. Wenn
Sie nicht der richtige Adressat sind oder diese E-Mail irrt�mlich erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das
unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".