001 /*
002 * Editor_AboutBox.java
003 *
004 * Copyright (c) 1998-2005, The University of Sheffield.
005 *
006 * This file is part of GATE (see http://gate.ac.uk/), and is free
007 * software, licenced under the GNU Library General Public License,
008 * Version 2, June1991.
009 *
010 * A copy of this licence is included in the distribution in the file
011 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html.
012 *
013 * Valentin Tablan, October 2000
014 *
015 * $Id: Editor_AboutBox.java 6491 2005-01-11 13:51:38Z ian $
016 */
017 package guk;
018
019 import java.awt.*;
020 import java.awt.event.*;
021
022 import javax.swing.*;
023
024 public class Editor_AboutBox extends JDialog implements ActionListener {
025
026 JPanel panel1 = new JPanel();
027 JPanel panel2 = new JPanel();
028 JPanel insetsPanel1 = new JPanel();
029 JPanel insetsPanel2 = new JPanel();
030 JPanel insetsPanel3 = new JPanel();
031 JButton button1 = new JButton();
032 JLabel imageLabel = new JLabel();
033 JLabel label1 = new JLabel();
034 JLabel label2 = new JLabel();
035 JLabel label3 = new JLabel();
036 JLabel label4 = new JLabel();
037 BorderLayout borderLayout1 = new BorderLayout();
038 BorderLayout borderLayout2 = new BorderLayout();
039 FlowLayout flowLayout1 = new FlowLayout();
040 GridLayout gridLayout1 = new GridLayout();
041 String product = "GATE Unicode Kit";
042 String version = "";
043 String copyright = "Copyright (c) 1999";
044 String comments = "";
045 public Editor_AboutBox(Frame parent) {
046 super(parent);
047 enableEvents(AWTEvent.WINDOW_EVENT_MASK);
048 try {
049 jbInit();
050 }
051 catch(Exception e) {
052 e.printStackTrace();
053 }
054 pack();
055 }// Editor_AboutBox(Frame parent)
056
057 /**Component initialization*/
058 private void jbInit() throws Exception {
059 //imageLabel.setIcon(new ImageIcon(EditorFrame_AboutBox.class.getResource("[Your Image]")));
060 this.setTitle("About");
061 setResizable(false);
062 panel1.setLayout(borderLayout1);
063 panel2.setLayout(borderLayout2);
064 insetsPanel1.setLayout(flowLayout1);
065 insetsPanel2.setLayout(flowLayout1);
066 insetsPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
067 gridLayout1.setRows(4);
068 gridLayout1.setColumns(1);
069 label1.setText("GATE Unicode Kit Editor");
070 label2.setText(version);
071 label3.setText("Copyright (c) 2000 - 2001");
072 label4.setText(comments);
073 insetsPanel3.setLayout(gridLayout1);
074 insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10));
075 button1.setText("Ok");
076 button1.addActionListener(this);
077 insetsPanel2.add(imageLabel, null);
078 panel2.add(insetsPanel2, BorderLayout.WEST);
079 this.getContentPane().add(panel1, null);
080 insetsPanel3.add(label1, null);
081 insetsPanel3.add(label2, null);
082 insetsPanel3.add(label3, null);
083 insetsPanel3.add(label4, null);
084 panel2.add(insetsPanel3, BorderLayout.CENTER);
085 insetsPanel1.add(button1, null);
086 panel1.add(insetsPanel1, BorderLayout.SOUTH);
087 panel1.add(panel2, BorderLayout.NORTH);
088 }// jbInit()
089
090 /**Overridden so we can exit when window is closed*/
091 protected void processWindowEvent(WindowEvent e) {
092 if (e.getID() == WindowEvent.WINDOW_CLOSING) {
093 cancel();
094 }
095 super.processWindowEvent(e);
096 }// processWindowEvent(WindowEvent e)
097
098 /**Close the dialog*/
099 void cancel() {
100 dispose();
101 }
102 /**Close the dialog on a button event*/
103 public void actionPerformed(ActionEvent e) {
104 if (e.getSource() == button1) {
105 cancel();
106 }
107 }// actionPerformed(ActionEvent e)
108 }// class Editor_AboutBox extends JDialog implements ActionListener
|