📄 ftpframe_aboutbox.java
字号:
/* * 10/01/2001 - 15:52:00 * * FtpGUI - Ftp client written in Java * Copyright (C) 2001 Kostadin Kirilov Kostadinov * k3co@hotmail.com * sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */package ftpgui;import java.awt.*;import java.awt.event.*;import java.beans.Beans;import javax.swing.*;import javax.swing.border.*;/** * Title: FtpGUI * Description: * Copyright: Copyright (c) 2001 * Company: * @author Kostadin Kirilov Kostadinov * @version 1.0 */public class FtpFrame_AboutBox extends JDialog implements ActionListener{ JPanel panel1 = new JPanel(); JPanel panel2; JPanel insetsPanel1; JPanel insetsPanel2; JPanel insetsPanel3; JButton button1; JLabel imageLabel; JLabel label1; JLabel label2; JLabel label3; JLabel label4; BorderLayout borderLayout1; BorderLayout borderLayout2; FlowLayout flowLayout1; GridLayout gridLayout1; String product = "FtpGUI"; String version = "1.0"; String copyright = "Copyright (c) 2001"; String comments = ""; public FtpFrame_AboutBox(Frame parent) { super(parent); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } pack(); } /**Component initialization*/ private void jbInit() throws Exception { gridLayout1 = (GridLayout)Beans.instantiate(getClass().getClassLoader(),GridLayout.class.getName()); flowLayout1 = (FlowLayout)Beans.instantiate(getClass().getClassLoader(),FlowLayout.class.getName()); borderLayout2 = (BorderLayout)Beans.instantiate(getClass().getClassLoader(),BorderLayout.class.getName()); borderLayout1 = (BorderLayout)Beans.instantiate(getClass().getClassLoader(),BorderLayout.class.getName()); label4 = (JLabel)Beans.instantiate(getClass().getClassLoader(),JLabel.class.getName()); label3 = (JLabel)Beans.instantiate(getClass().getClassLoader(),JLabel.class.getName()); label2 = (JLabel)Beans.instantiate(getClass().getClassLoader(),JLabel.class.getName()); label1 = (JLabel)Beans.instantiate(getClass().getClassLoader(),JLabel.class.getName()); imageLabel = (JLabel)Beans.instantiate(getClass().getClassLoader(),JLabel.class.getName()); button1 = (JButton)Beans.instantiate(getClass().getClassLoader(),JButton.class.getName()); insetsPanel3 = (JPanel)Beans.instantiate(getClass().getClassLoader(),JPanel.class.getName()); insetsPanel2 = (JPanel)Beans.instantiate(getClass().getClassLoader(),JPanel.class.getName()); insetsPanel1 = (JPanel)Beans.instantiate(getClass().getClassLoader(),JPanel.class.getName()); panel2 = (JPanel)Beans.instantiate(getClass().getClassLoader(),JPanel.class.getName()); //imageLabel.setIcon(new ImageIcon(FtpFrame_AboutBox.class.getResource("[Your Image]"))); this.setTitle("About"); setResizable(false); panel1.setLayout(borderLayout1); panel2.setLayout(borderLayout2); insetsPanel1.setLayout(flowLayout1); insetsPanel2.setLayout(flowLayout1); insetsPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); gridLayout1.setRows(4); gridLayout1.setColumns(1); label1.setText(product); label2.setText(version); label3.setText(copyright); label4.setText(comments); insetsPanel3.setLayout(gridLayout1); insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10)); button1.setText("Ok"); button1.addActionListener(this); insetsPanel2.add(imageLabel, null); panel2.add(insetsPanel2, BorderLayout.WEST); this.getContentPane().add(panel1, null); insetsPanel3.add(label1, null); insetsPanel3.add(label2, null); insetsPanel3.add(label3, null); insetsPanel3.add(label4, null); panel2.add(insetsPanel3, BorderLayout.CENTER); insetsPanel1.add(button1, null); panel1.add(insetsPanel1, BorderLayout.SOUTH); panel1.add(panel2, BorderLayout.NORTH); } /**Overridden so we can exit when window is closed*/ protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { cancel(); } super.processWindowEvent(e); } /**Close the dialog*/ void cancel() { dispose(); } /**Close the dialog on a button event*/ public void actionPerformed(ActionEvent e) { if (e.getSource() == button1) { cancel(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -