Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. class Lampe extends JPanel {
  2.  
  3.  
  4.  
  5. final BufferedImage background = ImageIO.read(new File("C:\\background.png"));
  6.  
  7. public Lampe() {
  8. setPreferredSize(new Dimension(400, 300));
  9.  
  10. }
  11.  
  12. @Override
  13. public void paintComponent(Graphics g) {
  14. super.paintComponent(g);
  15.  
  16. g.drawImage(background, 0, 0, null);
  17.  
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement