Saturday, March 5, 2011

Java - Giving background picture to a JFrame

Image bgImage = Toolkit.getDefaultToolkit().createImage(getClass().getResource("/src/ui/images/abc.jpg"));

public void paintComponent(Graphics g) {
        g.drawImage(bgImage,0,0,this);
}
 

0 comments:

Post a Comment

Contact Form

Name

Email *

Message *