aquaballoon

Java - Graphics

May 12th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package graphics;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Graphics;
  5. import java.awt.image.BufferedImage;
  6. import java.io.File;
  7. import javax.imageio.ImageIO;
  8.  
  9. public class Console extends Component{
  10.    
  11.     public BufferedImage img;
  12.    
  13.     Console(){
  14.         try{
  15.         img = ImageIO.read(new File("/home/jlee/Pictures/color.jpg"));
  16.         } catch(Exception e){
  17.            
  18.         }
  19.     }
  20.    
  21.     @Override
  22.     public void paint(Graphics g) {
  23.         g.drawImage(img, 0, 0, null);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment