📄 maindemouserframe2.java~29~
字号:
package logindemo;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.JComboBox;
import com.borland.jbcl.layout.BoxLayout2;
import java.awt.event.*;
import java.awt.Dimension;
import java.awt.BorderLayout;
import javax.swing.DebugGraphics;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class MainDemoUserFrame2 extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
JPanel contentPane;
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
CardLayout cardLayout1 = new CardLayout();
JPanel jPanel3 = new JPanel();
JPanel jPanel4 = new JPanel();
JPanel jPanel5 = new JPanel();
JPanel jPanel6 = new JPanel();
JLabel jLabel1 = new JLabel();
JTextField jTextField1 = new JTextField();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JComboBox jComboBox1 = new JComboBox();
JLabel jLabel2 = new JLabel();
JButton jButton3 = new JButton();
JComboBox jComboBox2 = new JComboBox();
JLabel jLabel3 = new JLabel();
JComboBox jComboBox3 = new JComboBox();
JButton jButton4 = new JButton();
JLabel jLabel4 = new JLabel();
BoxLayout2 boxLayout21 = new BoxLayout2();
JScrollPane jScrollPane1 = new JScrollPane();
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenu1 = new JMenu();
JMenu jMenu2 = new JMenu();
JMenu jMenu4 = new JMenu();
JMenuItem jMenuItem1 = new JMenuItem();
JMenuItem jMenuItem2 = new JMenuItem();
JMenuItem jMenuItem3 = new JMenuItem();
JMenuItem jMenuItem4 = new JMenuItem();
JMenuItem jMenuItem5 = new JMenuItem();
JTable jTable1 = new JTable();
JMenu jMenu5 = new JMenu();
JMenuItem jMenuItem6 = new JMenuItem();
JMenuItem jMenuItem7 = new JMenuItem();
JMenuItem jMenuItem8 = new JMenuItem();
JMenuItem jMenuItem9 = new JMenuItem();
public MainDemoUserFrame2() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(borderLayout1);
this.setJMenuBar(jMenuBar1);
setSize(new Dimension(495, 403));
setTitle("欢迎进入图书查询系统");
jPanel1.setLayout(cardLayout1);
jLabel1.setText("请输入书名");
jButton1.setText("搜索");
jButton1.addActionListener(new
MainDemoUserFrame2_jButton1_actionAdapter(this));
jButton2.setText("搜索 ");
jLabel2.setText("请输入作者");
jButton3.setText("搜索");
jLabel3.setText("请选择出版社");
jButton4.setText("搜索");
jLabel4.setText("请选择类别");
jPanel2.setLayout(boxLayout21);
this.setJMenuBar(jMenuBar1);
jMenu1.setText("查询");
jMenu2.setText("操作");
jMenu4.setText("文件");
jMenuItem1.setText("按书名查询");
jMenuItem1.addActionListener(new
MainDemoUserFrame2_jMenuItem1_actionAdapter(this));
jMenuItem2.setText("按作者查询");
jMenuItem2.addActionListener(new
MainDemoUserFrame2_jMenuItem2_actionAdapter(this));
jMenuItem3.setText("按出版社查询");
jMenuItem3.addActionListener(new
MainDemoUserFrame2_jMenuItem3_actionAdapter(this));
jMenuItem4.setText("按类别查询");
jMenuItem4.addActionListener(new
MainDemoUserFrame2_jMenuItem4_actionAdapter(this));
jMenuItem5.setText("退出");
jMenuItem5.addActionListener(new
MainDemoUserFrame2_jMenuItem5_actionAdapter(this));
jPanel3.addComponentListener(new
MainDemoUserFrame2_jPanel3_componentAdapter(this));
jPanel4.addComponentListener(new
MainDemoUserFrame2_jPanel4_componentAdapter(this));
jTextField1.setPreferredSize(new Dimension(100, 20));
jComboBox1.setPreferredSize(new Dimension(100, 23));
jComboBox2.setPreferredSize(new Dimension(100, 23));
jComboBox3.setPreferredSize(new Dimension(100, 23));
jMenu5.setText("帮助");
jMenuItem6.setText("关于");
jMenuItem6.addActionListener(new
MainDemoUserFrame2_jMenuItem6_actionAdapter(this));
jMenuItem7.setText("录入");
jMenuItem7.addActionListener(new
MainDemoUserFrame2_jMenuItem7_actionAdapter(this));
jMenuItem8.setText("修改");
jMenuItem9.setText("删除");
jPanel3.add(jLabel1);
jPanel3.add(jTextField1);
jPanel3.add(jButton1);
jPanel1.add(jPanel5, "jPanel5");
jPanel1.add(jPanel4, "jPanel4");
jPanel4.add(jLabel2);
jPanel4.add(jComboBox1);
jPanel4.add(jButton2);
jPanel1.add(jPanel3, "jPanel3");
jPanel5.add(jLabel3);
jPanel5.add(jLabel3);
jPanel5.add(jComboBox2);
jPanel5.add(jButton3);
jPanel1.add(jPanel6, "jPanel6");
jPanel6.add(jLabel4);
jPanel6.add(jComboBox3);
jPanel6.add(jButton4);
jPanel2.add(jScrollPane1);
jScrollPane1.getViewport().add(jTable1);
jPanel2.add(jTable1);
jMenuBar1.add(jMenu1);
jMenuBar1.add(jMenu2);
jMenuBar1.add(jMenu4);
jMenuBar1.add(jMenu5);
jMenu1.add(jMenuItem1);
jMenu1.add(jMenuItem2);
jMenu1.add(jMenuItem3);
jMenu1.add(jMenuItem4);
jMenu4.add(jMenuItem5);
jMenu5.add(jMenuItem6);
contentPane.add(jPanel2, java.awt.BorderLayout.SOUTH);
contentPane.add(jPanel1, java.awt.BorderLayout.NORTH);
jMenu2.add(jMenuItem7);
jMenu2.add(jMenuItem8);
jMenu2.add(jMenuItem9);
}
public void jMenuItem1_actionPerformed(ActionEvent e) {
cardLayout1.show(jPanel1, "jPanel3");
}
public void jMenuItem2_actionPerformed(ActionEvent e) {
cardLayout1.show(jPanel1, "jPanel4");
}
public void jMenuItem3_actionPerformed(ActionEvent e) {
cardLayout1.show(jPanel1, "jPanel5");
}
public void jMenuItem4_actionPerformed(ActionEvent e) {
cardLayout1.show(jPanel1, "jPanel6");
}
public void jMenuItem5_actionPerformed(ActionEvent e) {
System.exit(0);
}
public void jPanel3_componentShown(ComponentEvent componentEvent) {
}
public void jPanel4_componentShown(ComponentEvent componentEvent) {
}
public void jButton1_actionPerformed(ActionEvent e) {
}
public void jMenuItem6_actionPerformed(ActionEvent e) {
Frame1_AboutBox dlg = new Frame1_AboutBox(this);
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.setVisible(true);
}
public void jMenuItem7_actionPerformed(ActionEvent e) {
Input_Dialog1 id = new Input_Dialog1(this);
Dimension dlgSize = id.getPreferredSize();
Dimension frmSize = getSize();
Point loc = getLocation();
id.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
(frmSize.height - dlgSize.height) / 2 + loc.y);
id.setModal(true);
id.pack();
id.setVisible(true);
}
}
class MainDemoUserFrame2_jMenuItem7_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem7_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem7_actionPerformed(e);
}
}
class MainDemoUserFrame2_jMenuItem6_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem6_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem6_actionPerformed(e);
}
}
class MainDemoUserFrame2_jButton1_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jButton1_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class MainDemoUserFrame2_jPanel3_componentAdapter extends ComponentAdapter {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jPanel3_componentAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void componentShown(ComponentEvent componentEvent) {
adaptee.jPanel3_componentShown(componentEvent);
}
}
class MainDemoUserFrame2_jPanel4_componentAdapter extends ComponentAdapter {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jPanel4_componentAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void componentShown(ComponentEvent componentEvent) {
adaptee.jPanel4_componentShown(componentEvent);
}
}
class MainDemoUserFrame2_jMenuItem3_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem3_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem3_actionPerformed(e);
}
}
class MainDemoUserFrame2_jMenuItem4_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem4_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem4_actionPerformed(e);
}
}
class MainDemoUserFrame2_jMenuItem5_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem5_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem5_actionPerformed(e);
}
}
class MainDemoUserFrame2_jMenuItem2_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem2_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem2_actionPerformed(e);
}
}
class MainDemoUserFrame2_jMenuItem1_actionAdapter implements ActionListener {
private MainDemoUserFrame2 adaptee;
MainDemoUserFrame2_jMenuItem1_actionAdapter(MainDemoUserFrame2 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -