Re: japplet param
- From: Tom Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Tue, 24 Apr 2007 02:26:55 +0100
ryanoasis wrote:
java.lang.NullPointerException
at java.applet.Applet.getParameter(Unknown Source)
I have read that the getParameter call should be in init and also in
the default constructor. This doesnt
Where did you read that?[1]
The constructor must have completed before getParameter will work.
getParameter just forwards to the AppletStub (look at the source). Because your subclass of Applet calls the no-args Applet constructor (either implicitly or explicitly), there is no (reasonable) way the applet container can set the stub before your constructors have completed.
You should be able to call getParameter in the init method.
[1] As a point of pedantry a default constructor is technically a synthetic constructor provided by the compiler if there are no constructors is the class' source. A constructor with no arguments is generally referred to as a "no-args constructor".
Tom Hawtin
.
- References:
- japplet param
- From: ryanoasis
- japplet param
- Prev by Date: japplet param
- Next by Date: Re: How to create expanding Tables (Web 2.0 Style) with Swing ?
- Previous by thread: japplet param
- Index(es):
Relevant Pages
|