File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Repaint transparent BufferedImage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Repaint transparent BufferedImage" Watch "Repaint transparent BufferedImage" New topic

Repaint transparent BufferedImage

Jochem Gruter

Joined: Aug 16, 2011
Posts: 9
In my applet I make use of different bufferedimages and use them as a screen part. Each screenpart will only be repainted when the content needs to change. This is the abstract class of a 'screenpart'

But the buffer doesn't work because the buffer is also transparent. It will work when I change the bufferedimage type of the buffer from ARGB to RGB but this displays also a black background. So my question is: how can I correctly repaint this bufferedimage with a buffer?
Darryl Burke

Joined: May 03, 2008
Posts: 5115

Jochem Gruter wrote:Each screenpart will only be repainted when the content needs to change.

I don't see any code that attempts to change the image in any way. I also don't see the point of painting a new BufferedImage (buffer) of the same size to the BufferedImage that this class represents at the time of construction.

Perhaps a typical implementation of the abstract paint(...) method, along with a sample of how the method is called, and where the passed-in parameter is obtained, would help clarify the question. In other words, an SSCCE <- link

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: Repaint transparent BufferedImage
jQuery in Action, 3rd edition