public static BufferedImage loadImage(String ref) {
BufferedImage bimg = null;
try {
bimg = ImageIO.read(new File(ref));
} catch (Exception e) {
System.err.println("Error loading image file " + ref);
e.printStackTrace();
}
return bimg;
}
private BufferedImage originalImage = ...;
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(originalImage, 0, 0, originalImage.getWidth(), originalImage.getHeight(), null);
}