⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jimaboutbox.java

📁 100%Java编写及时报信工具
💻 JAVA
字号:
package jim;

import java.awt.*;
import javax.swing.*;
/* Copyright, 2001 Jason Dominiczak.
 *
 * This file is part of JIM - The Java Instant Messenger.
 * eMailer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.

 * JIM is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with eMailer; see the file COPYING. If not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA.
 */
public class JimAboutBox extends JDialog {

class IvjEventHandler implements java.awt.event.ActionListener {
		public void actionPerformed(java.awt.event.ActionEvent e) {
			if (e.getSource() == JimAboutBox.this.getOkButton()) 
				connEtoM1(e);
		};
	};
	private JLabel ivjAppName = null;
	private JPanel ivjButtonPane = null;
	private JLabel ivjCopyright = null;
	IvjEventHandler ivjEventHandler = new IvjEventHandler();
	private JLabel ivjIconLabel = null;
	private JPanel ivjIconPane = null;
	private JPanel ivjJDialogContentPane = null;
	private JButton ivjOkButton = null;
	private JLabel ivjSpacer = null;
	private JPanel ivjTextPane = null;
	private GridLayout ivjTextPaneGridLayout = null;
	private JLabel ivjUserName = null;
	private JLabel ivjVersion = null;
/**
 * JimAboutBox constructor comment.
 */
public JimAboutBox() {
	super();
	initialize();
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Dialog
 */
public JimAboutBox(Dialog owner) {
	super(owner);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Dialog
 * @param title java.lang.String
 */
public JimAboutBox(Dialog owner, String title) {
	super(owner, title);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Dialog
 * @param title java.lang.String
 * @param modal boolean
 */
public JimAboutBox(Dialog owner, String title, boolean modal) {
	super(owner, title, modal);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Dialog
 * @param modal boolean
 */
public JimAboutBox(Dialog owner, boolean modal) {
	super(owner, modal);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Frame
 */
public JimAboutBox(Frame owner) {
	super(owner);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Frame
 * @param title java.lang.String
 */
public JimAboutBox(Frame owner, String title) {
	super(owner, title);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Frame
 * @param title java.lang.String
 * @param modal boolean
 */
public JimAboutBox(Frame owner, String title, boolean modal) {
	super(owner, title, modal);
}
/**
 * JimAboutBox constructor comment.
 * @param owner java.awt.Frame
 * @param modal boolean
 */
public JimAboutBox(Frame owner, boolean modal) {
	super(owner, modal);
}
/**
 * connEtoM1:  (OkButton.action.actionPerformed(java.awt.event.ActionEvent) --> JimAboutBox.dispose()V)
 * @param arg1 java.awt.event.ActionEvent
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoM1(java.awt.event.ActionEvent arg1) {
	try {
		// user code begin {1}
		// user code end
		this.dispose();
		// user code begin {2}
		// user code end
	} catch (java.lang.Throwable ivjExc) {
		// user code begin {3}
		// user code end
		handleException(ivjExc);
	}
}
/**
 * Return the AppName property value.
 * @return javax.swing.JLabel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getAppName() {
	if (ivjAppName == null) {
		try {
			ivjAppName = new javax.swing.JLabel();
			ivjAppName.setName("AppName");
			ivjAppName.setText("Jim");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjAppName;
}
/**
 * Return the ButtonPane property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getButtonPane() {
	if (ivjButtonPane == null) {
		try {
			ivjButtonPane = new javax.swing.JPanel();
			ivjButtonPane.setName("ButtonPane");
			ivjButtonPane.setLayout(new java.awt.FlowLayout());
			getButtonPane().add(getOkButton(), getOkButton().getName());
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjButtonPane;
}
/**
 * Return the Copyright property value.
 * @return javax.swing.JLabel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getCopyright() {
	if (ivjCopyright == null) {
		try {
			ivjCopyright = new javax.swing.JLabel();
			ivjCopyright.setName("Copyright");
			ivjCopyright.setText("(c) Copyright 2001");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjCopyright;
}
/**
 * Return the IconLabel property value.
 * @return javax.swing.JLabel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getIconLabel() {
	if (ivjIconLabel == null) {
		try {
			ivjIconLabel = new javax.swing.JLabel();
			ivjIconLabel.setName("IconLabel");
			ivjIconLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dukeMagnify.gif")));
			ivjIconLabel.setText("");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjIconLabel;
}
/**
 * Return the IconPane property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getIconPane() {
	if (ivjIconPane == null) {
		try {
			ivjIconPane = new javax.swing.JPanel();
			ivjIconPane.setName("IconPane");
			ivjIconPane.setLayout(new java.awt.FlowLayout());
			getIconPane().add(getIconLabel(), getIconLabel().getName());
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjIconPane;
}
/**
 * Return the JDialogContentPane property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJDialogContentPane() {
	if (ivjJDialogContentPane == null) {
		try {
			ivjJDialogContentPane = new javax.swing.JPanel();
			ivjJDialogContentPane.setName("JDialogContentPane");
			ivjJDialogContentPane.setLayout(new java.awt.BorderLayout());
			getJDialogContentPane().add(getButtonPane(), "South");
			getJDialogContentPane().add(getTextPane(), "Center");
			getJDialogContentPane().add(getIconPane(), "West");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjJDialogContentPane;
}
/**
 * Return the OkButton property value.
 * @return javax.swing.JButton
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JButton getOkButton() {
	if (ivjOkButton == null) {
		try {
			ivjOkButton = new javax.swing.JButton();
			ivjOkButton.setName("OkButton");
			ivjOkButton.setText("OK");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjOkButton;
}
/**
 * Return the Spacer property value.
 * @return javax.swing.JLabel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getSpacer() {
	if (ivjSpacer == null) {
		try {
			ivjSpacer = new javax.swing.JLabel();
			ivjSpacer.setName("Spacer");
			ivjSpacer.setText("");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjSpacer;
}
/**
 * Return the TextPane property value.
 * @return javax.swing.JPanel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getTextPane() {
	if (ivjTextPane == null) {
		try {
			ivjTextPane = new javax.swing.JPanel();
			ivjTextPane.setName("TextPane");
			ivjTextPane.setLayout(getTextPaneGridLayout());
			getTextPane().add(getAppName(), getAppName().getName());
			getTextPane().add(getVersion(), getVersion().getName());
			getTextPane().add(getSpacer(), getSpacer().getName());
			getTextPane().add(getCopyright(), getCopyright().getName());
			getTextPane().add(getUserName(), getUserName().getName());
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjTextPane;
}
/**
 * Return the TextPaneGridLayout property value.
 * @return java.awt.GridLayout
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.GridLayout getTextPaneGridLayout() {
	java.awt.GridLayout ivjTextPaneGridLayout = null;
	try {
		/* Create part */
		ivjTextPaneGridLayout = new java.awt.GridLayout(5, 1);
	} catch (java.lang.Throwable ivjExc) {
		handleException(ivjExc);
	};
	return ivjTextPaneGridLayout;
}
/**
 * Return the UserName property value.
 * @return javax.swing.JLabel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getUserName() {
	if (ivjUserName == null) {
		try {
			ivjUserName = new javax.swing.JLabel();
			ivjUserName.setName("UserName");
			ivjUserName.setText("Administrator");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjUserName;
}
/**
 * Return the Version property value.
 * @return javax.swing.JLabel
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JLabel getVersion() {
	if (ivjVersion == null) {
		try {
			ivjVersion = new javax.swing.JLabel();
			ivjVersion.setName("Version");
			ivjVersion.setText("Version 1.0");
			// user code begin {1}
			// user code end
		} catch (java.lang.Throwable ivjExc) {
			// user code begin {2}
			// user code end
			handleException(ivjExc);
		}
	}
	return ivjVersion;
}
/**
 * Called whenever the part throws an exception.
 * @param exception java.lang.Throwable
 */
private void handleException(java.lang.Throwable exception) {

	/* Uncomment the following lines to print uncaught exceptions to stdout */
	// System.out.println("--------- UNCAUGHT EXCEPTION ---------");
	// exception.printStackTrace(System.out);
}
/**
 * Initializes connections
 * @exception java.lang.Exception The exception description.
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initConnections() throws java.lang.Exception {
	// user code begin {1}
	// user code end
	getOkButton().addActionListener(ivjEventHandler);
}
/**
 * Initialize the class.
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initialize() {
	try {
		// user code begin {1}
		// user code end
		setName("JimAboutBox");
		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
		setSize(330, 160);
		setTitle("JimAboutBox");
		setContentPane(getJDialogContentPane());
		initConnections();
	} catch (java.lang.Throwable ivjExc) {
		handleException(ivjExc);
	}
	// user code begin {2}
	// user code end
}
/**
 * main entrypoint - starts the part when it is run as an application
 * @param args java.lang.String[]
 */
public static void main(java.lang.String[] args) {
	try {
		JimAboutBox aJimAboutBox;
		aJimAboutBox = new JimAboutBox();
		aJimAboutBox.setModal(true);
		aJimAboutBox.addWindowListener(new java.awt.event.WindowAdapter() {
			public void windowClosing(java.awt.event.WindowEvent e) {
				System.exit(0);
			};
		});
		aJimAboutBox.show();
		java.awt.Insets insets = aJimAboutBox.getInsets();
		aJimAboutBox.setSize(aJimAboutBox.getWidth() + insets.left + insets.right, aJimAboutBox.getHeight() + insets.top + insets.bottom);
		aJimAboutBox.setVisible(true);
	} catch (Throwable exception) {
		System.err.println("Exception occurred in main() of javax.swing.JDialog");
		exception.printStackTrace(System.out);
	}
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -