001: /*
002: * @(#)AboutJDialog.java 1.0, 1 April 2000
003: *
004: * Copyright (c) 2000 Silv?re Martin-Michiellot All Rights Reserved.
005: *
006: * Silv?re Martin-Michiellot grants you ("Licensee") a non-exclusive,
007: * royalty free, license to use, modify and redistribute this
008: * software in source and binary code form,
009: * provided that i) this copyright notice and license appear on all copies of
010: * the software; and ii) Licensee does not utilize the software in a manner
011: * which is disparaging to Silv?re Martin-Michiellot.
012: *
013: * This software is provided "AS IS," without a warranty of any kind. ALL
014: * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
015: * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
016: * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. Silv?re Martin-Michiellot
017: * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
018: * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
019: * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
020: * Silv?re Martin-Michiellot OR ITS LICENSORS BE LIABLE
021: * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
022: * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
023: * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
024: * OR INABILITY TO USE SOFTWARE, EVEN IF Silv?re Martin-Michiellot HAS BEEN
025: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
026: *
027: * This software is not designed or intended for use in on-line control of
028: * aircraft, air traffic, aircraft navigation or aircraft communications; or in
029: * the design, construction, operation or maintenance of any nuclear
030: * facility. Licensee represents and warrants that it will not use or
031: * redistribute the Software for such purposes.
032: *
033: * @Author: Silv?re Martin-Michiellot
034: *
035: */
036:
037: package com.db.server;
038:
039: import java.awt.*;
040: import java.awt.event.*;
041: import javax.swing.*;
042: import java.util.*;
043:
044: class AboutJDialog extends JFrame implements ActionListener {
045:
046: private JPanel TheTopPanel;
047: private JPanel TheBottomPanel;
048: private JButton TheCloseButton;
049: private JTextArea TheTextArea;
050: private JScrollPane TheScrollPane;
051:
052: public AboutJDialog(ResourceBundle resourceBundle) {
053:
054: super ();
055:
056: this .setTitle(resourceBundle.getString("AboutTitle"));
057:
058: this .setSize(370, 380);
059: this .setResizable(false);
060:
061: this .getContentPane().setLayout(new BorderLayout());
062:
063: TheTopPanel = new JPanel();
064:
065: TheTopPanel.add(new JLabel(resourceBundle
066: .getString("AboutProductionTeamAndInfoLabel")));
067:
068: this .getContentPane().add(TheTopPanel, "North");
069:
070: TheTextArea = new JTextArea(resourceBundle
071: .getString("AboutProductionTeamAndInfo"), 20, 30);
072: TheTextArea.setToolTipText(resourceBundle
073: .getString("AboutToolTipTextAreaDescription"));
074: TheTextArea.getAccessibleContext().setAccessibleDescription(
075: resourceBundle.getString("AboutTextAreaDescription"));
076: TheTextArea.setLineWrap(true);
077: TheTextArea.setWrapStyleWord(true);
078: TheTextArea.setEditable(false);
079:
080: TheScrollPane = new JScrollPane(TheTextArea,
081: JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
082: JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
083: TheScrollPane.setToolTipText(resourceBundle
084: .getString("AboutToolTipScrollPaneDescription"));
085: TheScrollPane.getAccessibleContext().setAccessibleDescription(
086: resourceBundle.getString("AboutScrollPaneDescription"));
087:
088: this .getContentPane().add(TheScrollPane, "Center");
089:
090: TheBottomPanel = new JPanel();
091:
092: TheCloseButton = new JButton(resourceBundle
093: .getString("AboutCloseButton"));
094:
095: TheBottomPanel.add(TheCloseButton);
096: TheCloseButton.addActionListener(this );
097: TheCloseButton.setToolTipText(resourceBundle
098: .getString("AboutToolTipCloseButtonDescription"));
099: TheCloseButton
100: .getAccessibleContext()
101: .setAccessibleDescription(
102: resourceBundle
103: .getString("AboutCloseButtonDescription"));
104:
105: this .getContentPane().add(TheBottomPanel, "South");
106:
107: /* The following code is to close the windows. */
108:
109: this .addWindowListener(new WindowAdapter() {
110:
111: public void windowClosing(WindowEvent e) {
112:
113: setVisible(false);
114: dispose();
115:
116: }
117:
118: });
119:
120: this .addWindowListener(new WindowAdapter() {
121:
122: public void windowIconified(WindowEvent e) {
123:
124: setVisible(false);
125: dispose();
126:
127: }
128:
129: });
130:
131: }
132:
133: public void actionPerformed(ActionEvent TheActionEvent) {
134:
135: Object TheObject;
136:
137: TheObject = TheActionEvent.getSource();
138:
139: if (TheObject instanceof JButton) {
140: if (TheObject == TheCloseButton) {
141: this .TheCloseCommand();
142: }
143: }
144:
145: }
146:
147: private void TheCloseCommand() {
148:
149: this .setVisible(false);
150: this.dispose();
151:
152: }
153:
154: }
|