Hi
I am searching for the fastest way to draw a component’s background in AWT/Swing. Currently I use a JPanel and override the paintComponent() method. In this method I update a TYPE_3BYTE_BGR BufferedImage and simply draw it on the panel’s Graphics2D.
This seems odd to me, since the panel’s background is cleared with the background color each time it is redrawn. It would be better, if it was cleared with my BufferedImage directly. This would mean at least one huge pixel operation less.
How can I do this? Should I use a JLabel with my BufferedImage as an icon? Should I use a heavyweight component?
Thanks in advance,
Marvin