     /****************************************************************
      * Copyright (C) 1996 - 2001 Micro Focus International Ltd.     *
      * All Rights Reserved.                                         *
      ****************************************************************/

import java.awt.*;
import java.awt.event.*;

public class AboutBox extends Dialog
{
  Panel panel1 = new Panel();
  BorderLayout borderLayout1 = new BorderLayout();
  Panel panel2 = new Panel();
  GridLayout gridLayout1 = new GridLayout();
  Label blank3 = new Label();
  Label message = new Label();
  Label label1 = new Label();
  Label blank4 = new Label();
  Label blank5 = new Label();
  Panel panel3 = new Panel();
  GridLayout gridLayout2 = new GridLayout();
  Button aboutOKbutton = new Button();
  Label label2 = new Label();
  Label label3 = new Label();
  Label vendor_label = new Label();
  Label os_version_arch_label = new Label();

  String java_vendor = System.getProperty("java.vendor");
  String java_version = System.getProperty("java.version");
  String java_os = System.getProperty("os.name");
  String java_arch = System.getProperty("os.arch");
  String java_os_version = System.getProperty("os.version");

  Runtime java_runtime = Runtime.getRuntime();

  long memory_free = java_runtime.freeMemory();
  long memory_total = java_runtime.totalMemory();

  Label label4 = new Label();
  Label java_jvm_memory_label = new Label();
  Label java_jvm_memfree_label = new Label();

  public AboutBox(Frame frame, String title, boolean modal)
  {
    super(frame, title, modal);
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try
    {
      jbInit();
      add(panel1);
      pack();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }


  public AboutBox(Frame frame)
  {
    this(frame, "", false);
  }


  public AboutBox(Frame frame, boolean modal)
  {
    this(frame, "", modal);
  }


  public AboutBox(Frame frame, String title)
  {
    this(frame, title, false);
  }

  void jbInit() throws Exception
  {
    panel2.setLayout(gridLayout1);
    panel1.setFont(new Font("Dialog", 0, 16));
    gridLayout1.setRows(8);
    message.setFont(new Font("Dialog", 1, 16));
    message.setAlignment(1);
    message.setText("Record Demo");
    label1.setText("label1");
    blank4.setVisible(false);
    blank4.setText("blank4");
    blank5.setVisible(false);
    blank5.setText("blank5");
    aboutOKbutton.setLabel("OK");
    label2.setAlignment(1);
    label2.setText("v1.0 - January 2001");
    label3.setFont(new Font("Dialog", 1, 14));
    label3.setAlignment(1);
    label3.setText("Java Environment Information:");
    vendor_label.setFont(new Font("Dialog", 0, 12));
    vendor_label.setAlignment(1);
    vendor_label.setText(java_vendor + "("+ java_version + ")");
    os_version_arch_label.setFont(new Font("Dialog", 0, 12));
    os_version_arch_label.setAlignment(1);
    os_version_arch_label.setText(java_os + " on "+java_arch+","+java_os_version);
    label4.setAlignment(1);
    label4.setText("______________________________");
    java_jvm_memory_label.setFont(new Font("Dialog", 0, 12));
    java_jvm_memory_label.setAlignment(1);
    java_jvm_memory_label.setText("Memory available to JVM : "+
        Long.toString(memory_total));
    java_jvm_memfree_label.setFont(new Font("Dialog", 0, 12));
    java_jvm_memfree_label.setAlignment(1);
    java_jvm_memfree_label.setText("Memory free within JVM : "+
        Long.toString(memory_free));
    aboutOKbutton.addActionListener(new java.awt.event.ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        aboutOKbutton_actionPerformed(e);
      }
    });
    panel3.setLayout(gridLayout2);
    panel1.setLayout(borderLayout1);
    panel1.add(panel2, BorderLayout.CENTER);
    panel2.add(message, null);
    panel2.add(label2, null);
    panel2.add(label4, null);
    panel2.add(label3, null);
    panel2.add(vendor_label, null);
    panel2.add(os_version_arch_label, null);
    panel2.add(java_jvm_memory_label, null);
    panel2.add(java_jvm_memfree_label, null);
    panel1.add(blank3, BorderLayout.SOUTH);
    panel1.add(panel3, BorderLayout.SOUTH);
    panel3.add(blank5, null);
    panel3.add(aboutOKbutton, null);
    panel3.add(blank4, null);
  }

  protected void processWindowEvent(WindowEvent e)
  {
    if (e.getID() == WindowEvent.WINDOW_CLOSING)
    {
      cancel();
    }
    super.processWindowEvent(e);
  }

  void cancel()
  {
    dispose();
  }

  void aboutOKbutton_actionPerformed(ActionEvent e)
  {
    this.dispose();
  }
}

