Re: JPanel not visible in JApplet
- From: James Barrett <xucaen@xxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 17:39:08 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James Barrett wrote:
Hi all, I am experimenting with JApplet and JPanel.
My JApplet contains a JPanel called jpanel1 size 210x210.
I created a class myPanel which extends JPanel and I set its size to
210x210.
myPanel contains a Canvas called canvas1 and its size is 210x210.
But when I run the applet and draw an image to the canvas1, it is not
visible.
I call canvas1.setVisible(true), myPanel.setVisible(true) and
jpanel1.setVisible(true) and still my image is not visible.
I set canvas1.setLocation(0,0), myPanel.setLocation(0,0) and still my
image is not visible.
Is there something else that I should try to make the image visible?
Thanks,
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?
Thanks,
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHABd8QuDJiZ/QrH0RAlvRAKCBqzN2qYUzR7YtgQQvSETBxWZEigCdEozA
7iNuJd1CkoRg2qBCnNNYOLY=
=mCN0
-----END PGP SIGNATURE-----
.
- Follow-Ups:
- Re: JPanel not visible in JApplet
- From: Joshua Cranmer
- Re: JPanel not visible in JApplet
- Next by Date: Re: JPanel not visible in JApplet
- Next by thread: Re: JPanel not visible in JApplet
- Index(es):
Relevant Pages
|
|