home *** CD-ROM | disk | FTP | other *** search
- head 1.3;
- access;
- symbols;
- locks; strict;
- comment @# @;
-
-
- 1.3
- date 97.06.20.15.51.57; author bucchere; state Exp;
- branches;
- next 1.2;
-
- 1.2
- date 97.06.18.23.25.11; author bucchere; state Exp;
- branches;
- next 1.1;
-
- 1.1
- date 97.06.18.23.24.45; author bucchere; state Exp;
- branches;
- next ;
-
-
- desc
- @@
-
-
- 1.3
- log
- @Changed "What am I missing?" to "Click here to see what you're missing!" on
- Doug's suggestion -- he thought it was hard to tell that the gray screen is
- actually a button.
- @
- text
- @package alternative;
-
- import java.applet.*;
- import java.awt.*;
-
- public class Compatibility extends Applet {
- /* Should localize the following. */
- protected String labelText = "Your browser can't run 1.1 applets.";
- protected String filename; // value to be provided by a subclass
- PictureFrame frame;
-
- public void init() {
- setLayout(new BorderLayout());
-
- Button button = new Button("Click here to see what you're missing!");
- add("Center", button);
-
- Label label = new Label(labelText);
- label.setForeground(Color.red);
- add("North", label);
-
- System.out.println("Image filename is " + filename);
-
- if (filename == null) {
- label.disable();
- button.disable();
- return;
- }
- //needed because this is running under Switcher
- Applet parentApplet;
-
- /* Get the parent Applet object. */
- try {
- parentApplet = (Applet)getParent();
- } catch (ClassCastException e) {
- System.err.println("Parent isn't an Applet!");
- throw(e);
- }
-
- Image image = parentApplet.getImage(parentApplet.getCodeBase(), filename);
- String gifWidth = parentApplet.getParameter("GIFWIDTH");
- String gifHeight = parentApplet.getParameter("GIFHEIGHT");
- int w = 200;
- int h = 200;
-
- if (gifWidth != null) {
- try {
- w = Integer.parseInt(gifWidth);
- } catch (NumberFormatException e) {
- //Use default width.
- }
- }
-
- if (gifHeight != null) {
- try {
- h = Integer.parseInt(gifHeight);
- } catch (NumberFormatException e) {
- //Use default height.
- }
- }
-
- frame = new PictureFrame(image, w, h);
- }
-
- public void stop() {
- frame.hide();
- }
-
- public boolean action(Event e, Object arg) {
- if (frame != null) {
- frame.pack();
- frame.show();
- }
- return true;
- }
- }
- @
-
-
- 1.2
- log
- @Added package statement (used by switcher).
- @
- text
- @d15 1
- a15 1
- Button button = new Button("What Am I Missing?");
- d22 2
- d29 14
- a42 4
-
- Image image = getImage(getCodeBase(), filename);
- String gifWidth = getParameter("GIFWIDTH");
- String gifHeight = getParameter("GIFHEIGHT");
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d1 2
- @
-