G
George
Dear All,
I want to draw an image on a JPanel, but without going through the
addition of a new class that would be extending JPanel and would have a
super.paintComponent call in it.
I found that I can get a graphics object by doing panelName.getGraphics()
and then I can use that to draw an image using the drawImage method. It
all works (almost), but the image 'flickers' and dissapears rather than
staying on the panel. How can I get this to happen, i.e. keep the image on
the panel?
Regards,
George
I want to draw an image on a JPanel, but without going through the
addition of a new class that would be extending JPanel and would have a
super.paintComponent call in it.
I found that I can get a graphics object by doing panelName.getGraphics()
and then I can use that to draw an image using the drawImage method. It
all works (almost), but the image 'flickers' and dissapears rather than
staying on the panel. How can I get this to happen, i.e. keep the image on
the panel?
Regards,
George