public Debug()
  {
    if (GameApplet.thisApplet != null)
    {
      debugFlag = Debug.AWT_DEBUG = GameApplet.thisApplet.getParameter("AWT_DEBUG") == null ? false : true;
      if (!debugFlag)
        debugFlag = GameApplet.thisApplet.getParameter("DEBUG") != null;
    }
    else
    {
      try {
        debugFlag = Debug.AWT_DEBUG = System.getProperty("AWT_DEBUG") == null ? false : true;
        if (!debugFlag)
          debugFlag = System.getProperty("DEBUG") != null;
      }
      catch (Exception localException)
      {
        debugFlag = false;
      }
    }
    if (AWT_DEBUG)
    {
      debugFrame = new Frame("Debug Output");
      if (debugFlag)
      {
        handler = new ActionAdapter();
        text = new TextArea();
        debugFrame.setLayout(new BorderLayout());
        debugFrame.add(text, "Center");
        Panel localPanel = new Panel();
        debugFrame.add(localPanel, "South");
        Button localButton1 = new Button("Clear"); Button localButton2 = new Button("Close");
        localButton1.addActionListener(handler);
        localButton2.addActionListener(handler);
        localPanel.add(localButton1);
        localPanel.add(localButton2);
        debugFrame.pack();
        debugFrame.setVisible(true);
        Dimension localDimension = Toolkit.getDefaultToolkit().getScreenSize();
        debugFrame.setLocation(0, localDimension.height - debugFrame.getSize().height - 12);
        debugFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent paramWindowEvent) { Debug.debugFrame.setVisible(false); Debug.debugFrame.dispose(); }  } );
      }
    }
  }