[2929] in java-interest
Re: How to set the backgroud color?
daemon@ATHENA.MIT.EDU (Jim Graham)
Sat Oct 21 05:25:00 1995
Date: Wed, 18 Oct 1995 19:34:32 -0700
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
To: java-interest@java.Eng.Sun.COM, thu@dq.IConNet.COM
Hi Tony,
> 1. How do you set the background color within the applet area? The
setBackground(Color c)
It is implemented in Component so all Component objects support it
(including Applet).
> 2. This is probably related to the first one as well. When I load a gif
> with transparency index set, java seems to simply paint the transparent
> area into the default background color (grey), which doesn't realy
> achieve the desired transparent effect when you draw one image on the
> other. ANy insight?
Java doesn't paint anything for the transparent pixels of an image.
The background might be getting painted if you don't override update().
If your applet gets damage (i.e. it is behind some other window and
then that other window is moved away), the background of the exposed
or damaged area is filled with the background color and paint(Graphics g)
is called for you to repaint the applet.
If you call repaint(), then no background filling will occur but the
update(Graphics g) method will be called. If you don't override that
method, then the default implementation that will be executed for you
is to clear the background to the background color and to then call
paint(Graphics g).
...jim
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com