source: src/main/java/negotiator/onetomany/etc/Bob.java@ 216

Last change on this file since 216 was 216, checked in by Faria Nassiri Mofakham, 6 years ago
File size: 758 bytes
Line 
1package negotiator.onetomany.etc;
2
3import java.awt.Canvas;
4import java.awt.Color;
5import java.awt.Graphics;
6import java.awt.image.BufferedImage;
7import java.io.File;
8import java.net.URL;
9
10import javax.imageio.ImageIO;
11import javax.swing.JFrame;
12
13public class Bob extends Canvas
14{
15
16 {
17 private BufferedImage bobImage;
18
19 public Bob(String i)
20 {
21 try
22 {
23 bobImage = ImageIO.read(new File(getClass().getResource(i).toURI()));
24 }
25 catch (Exception e)
26 {
27 e.printStackTrace();
28 }
29 }
30
31 public void paint(Graphics g)
32 {
33 g.drawImage(bobImage, getWidth(), getHeight(), null);
34 }
35
36 }
37 }
38
39
Note: See TracBrowser for help on using the repository browser.