📄 wbmpeditorframe_aboutbox.java
字号:
package wbmp;import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.*;/** * The about box displayed for the WBMP editor. * Copyright (c) 2003 * @author Mark Busman * @version 1.0 * * For License and contact information see WBMPEditor.java */public class WBMPEditorFrame_AboutBox extends JDialog { String product = "WBMP Editor for the WAP Tool Kit"; String version = "1.0"; String copyright = "Copyright (c) 2001"; private GridLayout gridLayout1 = new GridLayout(); private JPanel insetsPanel3 = new JPanel(); private JLabel label3 = new JLabel(); private JLabel label2 = new JLabel(); private JLabel label1 = new JLabel(); private BorderLayout borderLayout1 = new BorderLayout(); private JPanel jPanel1 = new JPanel(); private JButton jButton1 = new JButton(); public WBMPEditorFrame_AboutBox(Frame parent) { super(parent); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); pack(); this.setResizable(false); } catch(Exception e) { e.printStackTrace(); } } /**Component initialization*/ private void jbInit() throws Exception { insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10)); insetsPanel3.setLayout(gridLayout1); gridLayout1.setColumns(1); gridLayout1.setRows(4); //imageLabel.setIcon(new ImageIcon(WBMPEditorFrame_AboutBox.class.getResource("[Your Image]"))); this.setModal(true); this.setTitle("About"); this.getContentPane().setLayout(borderLayout1); label3.setText(copyright); label2.setText(version); label1.setText(product); jButton1.setText("Ok"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); insetsPanel3.add(label1, null); insetsPanel3.add(label2, null); insetsPanel3.add(label3, null); this.getContentPane().add(jPanel1, BorderLayout.SOUTH); jPanel1.add(jButton1, null); this.getContentPane().add(insetsPanel3, BorderLayout.CENTER); } /**Overridden so we can exit when window is closed*/ protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { setVisible(false); dispose(); } super.processWindowEvent(e); } /** * Closes the about box. */ void jButton1_actionPerformed(ActionEvent e) { setVisible(false); dispose(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -