Mattie

Mattie-lap

Jan 23rd, 2010
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. package stap0;
  2.  
  3. import javax.imageio.*;
  4. import javax.swing.*;
  5. import java.awt.*;
  6. import java.awt.image.BufferedImage;
  7. import java.io.*;
  8.  
  9. public class Ansichtkaart extends JPanel
  10. {
  11.    
  12.     BufferedImage afbeelding;
  13.    
  14.     public Ansichtkaart()
  15.     {
  16.         try
  17.         {
  18.             afbeelding = ImageIO.read(new File("feest.png"));
  19.         } catch (IOException e)
  20.         {
  21.             e.printStackTrace();
  22.         }      
  23.     }
  24.    
  25.     public void paintComponent(Graphics g)
  26.     {
  27.         super.paintComponent(g);
  28.         g.drawImage(afbeelding,0,0,null);
  29.     }
  30.  
  31. }
Add Comment
Please, Sign In to add comment