I'm trying to use bufferedImage to display the bac kground of my application but i'm not successful.
I don't get what's wrong with it
here's the part of the code:
Graphics g;
BufferedImage offscreen;
offscreen= ImageIO.read(new File("mainScreen.png"));
g.drawImage(offscreen, 0, 0, null);
and i use the paintcomponent() here :
public void paintComponent(Graphics g){
g.drawImage(offscreen, 0, 0, null);
}