📄 mainframe.java
字号:
package psa;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class MainFrame extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); JToolBar jToolBar1 = new JToolBar(); JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); JButton jButton3 = new JButton(); JButton jButton4 = new JButton(); JButton jButton5 = new JButton(); JButton jButton6 = new JButton(); JPanel jPanel1 = new JPanel(); XYLayout xYLayout1 = new XYLayout(); JLabel jLabel1 = new JLabel(); //Construct the frame public MainFrame() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(662, 467)); this.setTitle("个人信息助理"); jButton1.setFont(new java.awt.Font("DialogInput", 0, 12)); jButton1.setMaximumSize(new Dimension(89, 49)); jButton1.setMinimumSize(new Dimension(89, 49)); jButton1.setPreferredSize(new Dimension(89, 49)); jButton1.setText("口令维护"); jButton1.addActionListener(new MainFrame_jButton1_actionAdapter(this)); jButton2.setFont(new java.awt.Font("DialogInput", 0, 12)); jButton2.setMaximumSize(new Dimension(89, 49)); jButton2.setMinimumSize(new Dimension(89, 49)); jButton2.setPreferredSize(new Dimension(89, 49)); jButton2.setText("日常记事"); jButton2.addActionListener(new MainFrame_jButton2_actionAdapter(this)); jButton3.setFont(new java.awt.Font("DialogInput", 0, 12)); jButton3.setMaximumSize(new Dimension(89, 49)); jButton3.setMinimumSize(new Dimension(89, 49)); jButton3.setPreferredSize(new Dimension(89, 49)); jButton3.setText("通讯簿"); jButton3.addActionListener(new MainFrame_jButton3_actionAdapter(this)); jButton4.setText("密码备忘"); jButton4.addActionListener(new MainFrame_jButton4_actionAdapter(this)); jButton4.setPreferredSize(new Dimension(89, 49)); jButton4.setMinimumSize(new Dimension(89, 49)); jButton4.setMaximumSize(new Dimension(89, 49)); jButton4.setFont(new java.awt.Font("DialogInput", 0, 12)); jButton5.setText("数据库管理"); jButton5.addActionListener(new MainFrame_jButton5_actionAdapter(this)); jButton5.setPreferredSize(new Dimension(89, 49)); jButton5.setMinimumSize(new Dimension(89, 49)); jButton5.setMaximumSize(new Dimension(89, 49)); jButton5.setFont(new java.awt.Font("DialogInput", 0, 12)); jButton6.setText("退出系统"); jButton6.addActionListener(new MainFrame_jButton6_actionAdapter(this)); jButton6.setPreferredSize(new Dimension(89, 49)); jButton6.setMinimumSize(new Dimension(89, 49)); jButton6.setMaximumSize(new Dimension(89, 49)); jButton6.setFont(new java.awt.Font("DialogInput", 0, 12)); jPanel1.setBackground(SystemColor.inactiveCaption); jPanel1.setLayout(xYLayout1); jLabel1.setFont(new java.awt.Font("DialogInput", 1, 48)); jLabel1.setForeground(Color.yellow); jLabel1.setText("个人信息助理工具"); contentPane.add(jToolBar1, BorderLayout.NORTH); jToolBar1.add(jButton1, null); jToolBar1.add(jButton2, null); jToolBar1.add(jButton3, null); jToolBar1.add(jButton4, null); jToolBar1.add(jButton5, null); jToolBar1.add(jButton6, null); contentPane.add(jPanel1, BorderLayout.CENTER); jPanel1.add(jLabel1, new XYConstraints(112, 99, 412, 142)); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } void jButton5_actionPerformed(ActionEvent e) { DB_Dialog dlg = new DB_Dialog(); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); } void jButton1_actionPerformed(ActionEvent e) { User_Dialog dlg = new User_Dialog(); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); } void jButton6_actionPerformed(ActionEvent e) { System.exit(0); } void jButton2_actionPerformed(ActionEvent e) { NotePad_Dialog dlg = new NotePad_Dialog(); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); } void jButton3_actionPerformed(ActionEvent e) { AddrBook_Dialog dlg = new AddrBook_Dialog(); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); } void jButton4_actionPerformed(ActionEvent e) { Password_Dialog dlg = new Password_Dialog(); Dimension dlgSize = dlg.getPreferredSize(); Dimension frmSize = getSize(); Point loc = getLocation(); dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y); dlg.setModal(true); dlg.pack(); dlg.show(); }}class MainFrame_jButton5_actionAdapter implements java.awt.event.ActionListener { MainFrame adaptee; MainFrame_jButton5_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton5_actionPerformed(e); }}class MainFrame_jButton1_actionAdapter implements java.awt.event.ActionListener { MainFrame adaptee; MainFrame_jButton1_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}class MainFrame_jButton6_actionAdapter implements java.awt.event.ActionListener { MainFrame adaptee; MainFrame_jButton6_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton6_actionPerformed(e); }}class MainFrame_jButton2_actionAdapter implements java.awt.event.ActionListener { MainFrame adaptee; MainFrame_jButton2_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton2_actionPerformed(e); }}class MainFrame_jButton3_actionAdapter implements java.awt.event.ActionListener { MainFrame adaptee; MainFrame_jButton3_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton3_actionPerformed(e); }}class MainFrame_jButton4_actionAdapter implements java.awt.event.ActionListener { MainFrame adaptee; MainFrame_jButton4_actionAdapter(MainFrame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton4_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -