head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 97.11.09.01.23.12; author kowallik; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @// the extra frame which contains all the controls // for the pendulum animation import java.awt.*; import java.lang.*; public class Welcome extends Frame { Graphics g; Dimension d; Welcome(main parent) { this.resize(320, 200); this.setTitle("Greetings"); } public void paint(Graphics g) { Font font; FontMetrics fm; g = this.getGraphics(); d = this.size(); if(g!=null) { font = new Font("Helvetica", Font.ITALIC, 24); g.setFont(font); fm = g.getFontMetrics(); g.drawString("The Chaotic Pendulum", (int) ((d.width-fm.stringWidth("The Chaotic Pendulum"))/2), 80); font = new Font("Helvetica", Font.PLAIN, 18); g.setFont(font); fm = g.getFontMetrics(); g.drawString("Animation of Complicated Behavior", (int) ((d.width-fm.stringWidth("Animation of Complicated Behavior"))/2), 110); font = new Font("Helvetica", Font.PLAIN, 14); g.setFont(font); fm = g.getFontMetrics(); g.drawString("written by", (int) ((d.width-fm.stringWidth("written by"))/2), 140); font = new Font("Helvetica", Font.PLAIN, 24); g.setFont(font); g.setColor(new Color(0, 0, 96)); fm = g.getFontMetrics(); g.drawString("Hans Kowallik", (int) ((d.width-fm.stringWidth("Hans Kowallik"))/2), 180); } } public void update(Graphics g) { paint(g); } public boolean handleEvent(Event evt) { switch(evt.id) { case Event.MOUSE_DOWN: { this.dispose(); } }return false; } } @