/** * AboutBox.java 1.00 12.18.96 Michael Shoffner * * Copyright (c) 1996 Prominence Dot Com, Inc. All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * for non-commercial purposes and without fee is hereby granted * provided that this copyright notice appears in all copies. * * http://prominence.com/ shoffner@prominence.com */ import java.awt.*; public class AboutBox extends Frame { public AboutBox () { super ("About"); setForeground (Color.black); setBackground (Color.white); // resize (250, 130); setResizable (false); pack(); show(); } public void paint (Graphics g) { int LEADING = 2; int VERT = 20; FontMetrics f = getFontMetrics (getFont()); String s = "Discussion Forum 1.0"; g.drawString(s, ((size().width)-f.stringWidth(s))/2, insets().top + VERT); s = "Michael Shoffner "; g.drawString(s, ((size().width)-f.stringWidth(s))/2, insets().top+f.getHeight() + LEADING + VERT); s = "http://prominence.com/"; g.drawString(s, ((size().width)-f.stringWidth(s))/2, insets().top+ 2*(f.getHeight() + LEADING) + VERT); } public boolean handleEvent (Event e) { if ((e.id == Event.MOUSE_DOWN) || (e.id == Event.WINDOW_DESTROY)) hide(); return super.handleEvent(e); } public Dimension preferredSize () { return new Dimension (300, 150); } }