I don't think anyone has seriously used this technique since double-buffereing (etc) was introduced aroubd Java 1.5 (?).
Simply create a subclass of JPanel. Load your image into memory in the constructor. Override its paintComponent to paint your image onto the Graphics passed as parameter.
JamesCherrill
... trying to help
8,667 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,477
Skill Endorsements: 33
You have all the keywords for a Google search right there. There are so many examples on the web, you can't ask anyone to create yet another one.
JamesCherrill
... trying to help
8,667 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,477
Skill Endorsements: 33
@JamesCherrill
is not used, but to avoiding of catching the image, I'm not good in Graphics, but I saw a few suggestion to use byte[] and ImageObserver, but for JPanels Background, there is paintComponent best of ways (with boolean for repaint())
mKorbel
Nearly a Posting Virtuoso
1,228 posts since Feb 2011
Reputation Points: 482
Solved Threads: 244
Skill Endorsements: 14