import java.io.*; 
import java.net.*; 
import java.awt.*;
import java.awt.event.*;
import java.util.Properties;

public class Barton extends Frame {
  Image im;    
  Font f;
  String fontDefault = "Serif-bolditalic-24";
  String msg;
  String msgDefault = "Donate Blood";
  Color savedColor;
  public Barton () {
    super ("Donate Blood");
    // Find Resource File


    // Load file and setup display resources
    try {
      Properties p = new Properties();

      // Load properties from resource input stream

      // Get font from 'message.font'
      // If not found, use fontDefault


      // Get message from 'message.text'
      // If not found, use msgDefault

      // Get Image file
      // Get image file name from 'image.file' property

      // Get image as resource

    } catch (Exception e) {
      f = Font.decode (fontDefault);
      msg = msgDefault;
      im = null;
      System.err.println ("Using default properties.");
    }
    setFont (f);
    // Setup dealing with Window Closing
    enableEvents (AWTEvent.WINDOW_EVENT_MASK);
  }
  public void paint (Graphics g) {
    if (im == null) {
      savedColor = g.getColor();
      g.setColor (Color.red);
      g.fillRect (50, 25, 30, 80);
      g.fillRect (25, 50, 80, 30);
      g.setColor (savedColor);
    } else {
      g.drawImage (im, 25, 20, this);
    }
    g.drawString (msg, 50, 130);
  }
  protected void processWindowEvent (WindowEvent e) {
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
      System.exit (0);
    }
  }
  public static void main (String args[]) {
    Barton b = new Barton();
    b.setSize (300, 200);
    b.show();
  }
}
