Line | |
---|
1 | package negotiator.onetomany.etc;
|
---|
2 |
|
---|
3 | import java.awt.Canvas;
|
---|
4 | import java.awt.Color;
|
---|
5 | import java.awt.Graphics;
|
---|
6 | import java.awt.image.BufferedImage;
|
---|
7 | import java.io.File;
|
---|
8 | import java.net.URL;
|
---|
9 |
|
---|
10 | import javax.imageio.ImageIO;
|
---|
11 | import javax.swing.JFrame;
|
---|
12 |
|
---|
13 | public class Bob extends Canvas
|
---|
14 | {
|
---|
15 |
|
---|
16 | {
|
---|
17 | 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.