Re: JPanel not visible in JApplet
- From: Joshua Cranmer <Pidgeot18@xxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 21:45:33 GMT
James Barrett wrote:
I have narrowed it down but I don't fully understand why this is
happening. If I draw an image during the init() method nothing is
displayed, even if I put the setVisibale and setLocation method calls
before the drawImage method. But after the applet is inited, then images
can be drawn. but why? I want to display an image with out user
intervention, and as far as I know, that can only be done during init().
Is there another way?
Typically, drawing is done by paint() and not init(). init() is the code called when your applet is first invoked.
Perhaps you might want to look at
http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html ?
--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.
- Follow-Ups:
- Re: JPanel not visible in JApplet
- From: James Barrett
- Re: JPanel not visible in JApplet
- From: James Barrett
- Re: JPanel not visible in JApplet
- References:
- Re: JPanel not visible in JApplet
- From: James Barrett
- Re: JPanel not visible in JApplet
- Prev by Date: Re: JPanel not visible in JApplet
- Next by Date: Re: JPanel not visible in JApplet
- Previous by thread: Re: JPanel not visible in JApplet
- Next by thread: Re: JPanel not visible in JApplet
- Index(es):
Relevant Pages
|
|