📄 aboutdialog.java
字号:
/*** $Id: AboutDialog.java,v 1.5 2001/05/07 12:37:21 kunugi Exp $**** Copyright (c) 2000-2001 Jeff Gay** on behalf of ICEMail.org <http://www.icemail.org>** Copyright (c) 1998-2000 by Timothy Gerard Endres** ** This program is free software.** ** You may redistribute it and/or modify it under the terms of the GNU** General Public License as published by the Free Software Foundation.** Version 2 of the license should be included with this distribution in** the file LICENSE, as well as License.html. If the license is not** included with this distribution, you may find a copy at the FSF web** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.**** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR** REDISTRIBUTION OF THIS SOFTWARE. ** */package org.icemail.mail;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Dimension;import java.awt.Font;import java.awt.Frame;import java.awt.Image;import java.awt.Insets;import java.awt.Point;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.IOException;import javax.swing.JButton;import javax.swing.JDialog;import javax.swing.JLabel;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.JTextArea;import javax.swing.ImageIcon;import javax.swing.border.EmptyBorder;import org.icemail.util.AWTUtilities;import org.icemail.util.JFCUtilities;/** * Create a dialog containing information about the application. */public class AboutDialog extends JDialog{ private JTextArea messageText_ = null; /** * Construct an dialog, associating it with the given parent frame. */ public AboutDialog( Frame parent ) { super( parent, "About ICEMail", true ); establishDialogContents(); pack(); Dimension sz = getSize(); Point location = AWTUtilities.computeDialogLocation( this, sz.width, sz.height ); setLocation( location.x, location.y ); } /** * Dispose of the dialog and any allocated resources. * <p> * Implementation of java.awt.Window.dispose() */ public void dispose() { messageText_ = null; super.dispose(); } /** * Establish the contents of the dialog. */ private void establishDialogContents() { JLabel logoLabel = null; try { Image img = AWTUtilities.getImageResource( "/org/icemail/mail/images/splash.gif" ); ImageIcon icon = new ImageIcon( img ); logoLabel = new JLabel( icon ); } catch ( IOException ex ) { logoLabel = new JLabel( "ICEMail" ); } logoLabel.setOpaque( true ); logoLabel.setBackground( Color.white ); logoLabel.setBorder( JFCUtilities.StandardBorder ); messageText_ = new JTextArea(); messageText_.setEditable( false ); messageText_.setOpaque( true ); messageText_.setMargin( new Insets( 5, 5, 5, 5 ) ); messageText_.setBorder( JFCUtilities.StandardBorder ); messageText_.setFont( Font.getFont( "aboutDialog.font", new Font( "Serif", Font.PLAIN, 12 ) ) ); messageText_.setText( "ICEMail Release " + ICEMail.getVersionString() + ", Java EMail Client\n" + "\n" + "Copyright (c) 2000-2001 Jeff Gay, Lucy Zhao\n" + "on behalf of ICEMail.org <http://www.icemail.org>\n" + "Copyright (c) 1998-2000 by Timothy Gerard Endres\n" + "\n" + "POP3 SPI by Y. Miyadate, miyadate@mvi.biglobe.ne.jp\n" + "Copyright (c) 1999 by Y. Miyadate\n" + "\n" + "ICEMail is free software, which is licensed to you under the\n" + "GNU General Public License, version 2. Please see the file\n" + "GettingStarted.htm for more details on licenses.\n" + "\n" + "This software is provided AS-IS, with ABSOLUTELY NO WARRANTY.\n" + "YOU ASSUME ALL RESPONSIBILITY FOR ANY AND ALL CONSEQUENCES\n" + "THAT MAY RESULT FROM THE USE OF THIS SOFTWARE!" ); JScrollPane scroller = new JScrollPane(); scroller.getViewport().add( messageText_ ); JPanel ctlPan = new JPanel(); ctlPan.setBorder( new EmptyBorder( 5, 7, 3, 3 ) ); ctlPan.setLayout( new BorderLayout() ); JButton button = new JButton( "Dismiss" ); button.addActionListener( new IActionListener() ); button.setActionCommand( "OK" ); ctlPan.add( BorderLayout.EAST, button ); JPanel content = new JPanel(); content.setLayout( new BorderLayout( 0, 8 ) ); content.setBorder( new EmptyBorder( 6, 6, 6, 6 ) ); content.add( BorderLayout.NORTH, logoLabel ); content.add( BorderLayout.CENTER, scroller ); content.add( BorderLayout.SOUTH, ctlPan ); getContentPane().add( content ); }//............................................................ private class IActionListener implements ActionListener { /** * Invoked when an action occurs. * <p> * Implementation of java.awt.event.ActionListener.actionPerformed() * * @param event the action event that occured */ public void actionPerformed( ActionEvent event ) { String command = event.getActionCommand(); if ( command.compareTo( "OK" ) == 0 ) { dispose(); } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -