Java Graphics2D: filling with transparency?

G. ClearRect(..) fills the selected rectangle with the background colour of the Graphics2D object. You're better off doing g.

FillRect(..) which would give the intended result with your code, or set the background colour of the Graphics2D object beforehand ( g. SetBackground(..) ) Also, you may have to do g. SetComposite(AlphaComposite.

GetInstance(AlphaComposite. SRC)) before the fill so that it sets the buffer properly (ignore destination buffer data, only use source data -- in this case, the fill operation). Not sure what the default is for this value, but you should set it back to that afterwards to ensure proper operation.

G. ClearRect(..) fills the selected rectangle with the background colour of the Graphics2D object. You're better off doing g.

FillRect(..) which would give the intended result with your code, or set the background colour of the Graphics2D object beforehand (g. SetBackground(..)). Also, you may have to do g.

SetComposite(AlphaComposite. GetInstance(AlphaComposite. SRC)); before the fill so that it sets the buffer properly (ignore destination buffer data, only use source data -- in this case, the fill operation).

Not sure what the default is for this value, but you should set it back to that afterwards to ensure proper operation.

Thanks! SetBackground was the solution. – Pierre Dec 30 '10 at 20:27.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions