home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / 1&1 / java.z / java_301 / netscape / applet / Console.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-10-20  |  1.4 KB  |  38 lines

  1. package netscape.applet;
  2.  
  3. import java.io.BufferedOutputStream;
  4. import java.io.InputStream;
  5. import java.io.PrintStream;
  6.  
  7. class Console {
  8.    ConsoleFrame frame = new ConsoleFrame(this);
  9.  
  10.    Console() {
  11.       InputStream in = new ConsoleInputStream(this);
  12.       PrintStream out = new PrintStream(new BufferedOutputStream(new ConsoleOutputStream(this), 128), true);
  13.       setSystemIO(in, out, out);
  14.    }
  15.  
  16.    private static native void setSystemIO(InputStream var0, PrintStream var1, PrintStream var2);
  17.  
  18.    void reset() {
  19.       this.frame.reset();
  20.    }
  21.  
  22.    void show() {
  23.       if (!this.frame.isVisible()) {
  24.          this.frame.show();
  25.          MozillaAppletContext.setConsoleState(1);
  26.       }
  27.  
  28.    }
  29.  
  30.    void hide() {
  31.       if (this.frame.isVisible()) {
  32.          this.frame.hide();
  33.          MozillaAppletContext.setConsoleState(0);
  34.       }
  35.  
  36.    }
  37. }
  38.