|
Editor_AboutBox |
|
1 /* 2 * Editor_AboutBox.java 3 * 4 * Copyright (c) 2000-2001, The University of Sheffield. 5 * 6 * This file is part of GATE (see http://gate.ac.uk/), and is free 7 * software, licenced under the GNU Library General Public License, 8 * Version 2, June1991. 9 * 10 * A copy of this licence is included in the distribution in the file 11 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html. 12 * 13 * Valentin Tablan, October 2000 14 * 15 * $Id: Editor_AboutBox.java,v 1.2 2001/04/17 18:07:50 oana Exp $ 16 */ 17 package guk; 18 19 import java.awt.*; 20 import java.awt.event.*; 21 import javax.swing.*; 22 import javax.swing.border.*; 23 24 public class Editor_AboutBox extends JDialog implements ActionListener { 25 26 JPanel panel1 = new JPanel(); 27 JPanel panel2 = new JPanel(); 28 JPanel insetsPanel1 = new JPanel(); 29 JPanel insetsPanel2 = new JPanel(); 30 JPanel insetsPanel3 = new JPanel(); 31 JButton button1 = new JButton(); 32 JLabel imageLabel = new JLabel(); 33 JLabel label1 = new JLabel(); 34 JLabel label2 = new JLabel(); 35 JLabel label3 = new JLabel(); 36 JLabel label4 = new JLabel(); 37 BorderLayout borderLayout1 = new BorderLayout(); 38 BorderLayout borderLayout2 = new BorderLayout(); 39 FlowLayout flowLayout1 = new FlowLayout(); 40 GridLayout gridLayout1 = new GridLayout(); 41 String product = "Gate Unicode Kit"; 42 String version = ""; 43 String copyright = "Copyright (c) 1999"; 44 String comments = ""; 45 public Editor_AboutBox(Frame parent) { 46 super(parent); 47 enableEvents(AWTEvent.WINDOW_EVENT_MASK); 48 try { 49 jbInit(); 50 } 51 catch(Exception e) { 52 e.printStackTrace(); 53 } 54 pack(); 55 }// Editor_AboutBox(Frame parent) 56 57 /**Component initialization*/ 58 private void jbInit() throws Exception { 59 //imageLabel.setIcon(new ImageIcon(EditorFrame_AboutBox.class.getResource("[Your Image]"))); 60 this.setTitle("About"); 61 setResizable(false); 62 panel1.setLayout(borderLayout1); 63 panel2.setLayout(borderLayout2); 64 insetsPanel1.setLayout(flowLayout1); 65 insetsPanel2.setLayout(flowLayout1); 66 insetsPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); 67 gridLayout1.setRows(4); 68 gridLayout1.setColumns(1); 69 label1.setText("Gate Unicode Kit Editor"); 70 label2.setText(version); 71 label3.setText("Copyright (c) 2000 - 2001"); 72 label4.setText(comments); 73 insetsPanel3.setLayout(gridLayout1); 74 insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10)); 75 button1.setText("Ok"); 76 button1.addActionListener(this); 77 insetsPanel2.add(imageLabel, null); 78 panel2.add(insetsPanel2, BorderLayout.WEST); 79 this.getContentPane().add(panel1, null); 80 insetsPanel3.add(label1, null); 81 insetsPanel3.add(label2, null); 82 insetsPanel3.add(label3, null); 83 insetsPanel3.add(label4, null); 84 panel2.add(insetsPanel3, BorderLayout.CENTER); 85 insetsPanel1.add(button1, null); 86 panel1.add(insetsPanel1, BorderLayout.SOUTH); 87 panel1.add(panel2, BorderLayout.NORTH); 88 }// jbInit() 89 90 /**Overridden so we can exit when window is closed*/ 91 protected void processWindowEvent(WindowEvent e) { 92 if (e.getID() == WindowEvent.WINDOW_CLOSING) { 93 cancel(); 94 } 95 super.processWindowEvent(e); 96 }// processWindowEvent(WindowEvent e) 97 98 /**Close the dialog*/ 99 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
|
Editor_AboutBox |
|