home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-08-06 | 1.6 KB | 81 lines |
- /*
- * Copyright (c) 1995 by Jan Andersson, Torpa Konsult AB.
- *
- * Permission to use, copy, and distribute this software for
- * NON-COMMERCIAL purposes and without fee is hereby granted
- * provided that this copyright notice appears in all copies.
- */
- import java.awt.*;
- import java.applet.Applet;
-
- /**
- * FunScroll "about" popup.
- *
- * @version 1.1 97/08/06
- * @author Jan Andersson (janne@torpa.se)
- */
- public class FunScrollAbout extends Frame
- {
-
- static final int rows = 27;
- static final int cols = 70;
-
- TextArea info;
- Button close;
-
- /**
- * Create About popup frame
- */
- FunScrollAbout(String label) {
- super(label);
-
- add("Center", info = new TextArea(rows, cols));
- info.setEditable(false);
- //info.setBackground(Color.white);
-
- Panel buttons = new Panel();
- add("South", buttons);
- buttons.add(close = new Button("Close"));
-
- pack();
- }
-
- /**
- * Show frame
- */
- public void show() {
- info.select(0,0);
- super.show();
- }
-
- /**
- * Append text
- */
- void appendText(String s) {
- info.appendText(s);
- }
-
- /**
- * Handle window destroy event
- */
- public boolean handleEvent(Event e) {
- if (e.id == Event.WINDOW_DESTROY) {
- dispose();
- return true;
- }
- return super.handleEvent(e);
- }
-
- /**
- * Handle "close" button action
- */
- public boolean action(Event e, Object arg) {
- if (e.target == close) {
- //hide();
- dispose();
- return true;
- }
- return false;
- }
- }
-