Back to index

moin  1.9.0~rc2
TestFrame.java
Go to the documentation of this file.
00001 package CH.ifa.draw.twiki;
00002 import java.awt.*;
00003 import java.awt.event.*;
00005 import java.util.*;
00006 import java.io.*;
00007 import java.net.*;
00008 
00009 public class TestFrame extends Frame
00010 {
00011        private Image image = null;
00012 
00013        public TestFrame()
00014        {
00015               super();
00016        }
00017 
00018        public TestFrame(String title)
00019        {
00020               super(title);
00021        }
00022 
00023        public void setImage(Image theImage)
00024        {
00025               image = theImage;
00026               MediaTracker tracker = new MediaTracker(this);
00027               tracker.addImage(theImage, 0);
00028               try {
00029                      tracker.waitForAll();
00030               } catch (Exception e) {  }
00031        }
00032 
00033        public void paint(Graphics g)
00034        {
00035               if(image != null) {
00036                      g.drawImage(image, 0, 20, this);
00037               }
00038 //            g.setColor(Color.red);
00039 //            g.fillOval(0, 20, 32, 52);
00040        }
00041 
00042        public void update(Graphics g)
00043        {
00044               paint(g);
00045        }
00046 }