home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-03-06 | 684 b | 34 lines |
- import java.awt.*;
- import java.applet.*;
-
- public class FrameApplet extends Applet
- {
- Frame frame;
- Button button;
-
- public void init()
- {
- frame = new Frame("Frame Window");
- button = new Button("Show Window");
- add(button);
- }
-
- public boolean action(Event evt, Object arg)
- {
- boolean visible = frame.isShowing();
- if (visible)
- {
- frame.hide();
- button.setLabel("Show Window");
- }
- else
- {
- frame.show();
- frame.resize(200, 100);
- button.setLabel("Hide Window");
- }
-
- return true;
- }
- }
-