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

📄 mainmenu.java~23~

📁 java房产管理系统
💻 JAVA~23~
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class MainMenu
    extends JFrame {
  JPanel contentPane;
  JMenuBar jMenuBar = new JMenuBar();
  JMenu jMenuSystem = new JMenu();
  JMenuItem jMItemExit = new JMenuItem();
  JMenu jMenuHouseManager = new JMenu();
  JMenuItem jMItemBuildInfo = new JMenuItem();
  BorderLayout borderLayout1 = new BorderLayout();
  JMenuItem jMItemCodeSet = new JMenuItem();
  JMenuItem jMItemHouseInfo = new JMenuItem();
  JMenu jMenuOwner = new JMenu();
  JMenuItem jMItemBasicInfo = new JMenuItem();
  JMenuItem jMItemFamilyInfo = new JMenuItem();
  JMenu jMenuQuery = new JMenu();
  JMenuItem jMItemHouseQuery = new JMenuItem();
  JMenuItem jMItemOwnerQuery = new JMenuItem();
  JMenuItem jMItemComboQuery = new JMenuItem();

  //Construct the frame
  public MainMenu() {
    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.getContentPane().setBackground(SystemColor.controlLtHighlight);
    this.setSize(new Dimension(576, 372));
    this.setTitle("房产管理系统");
    jMenuSystem.setBackground(SystemColor.controlHighlight);
    jMenuSystem.setFont(new java.awt.Font("宋体", 0, 12));
    jMenuSystem.setText("系统管理");
    jMItemExit.setBackground(SystemColor.controlHighlight);
    jMItemExit.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemExit.setText("退出");
    jMItemExit.addActionListener(new MainMenu_jMItemExit_actionAdapter(this));
    jMenuHouseManager.setBackground(SystemColor.controlHighlight);
    jMenuHouseManager.setFont(new java.awt.Font("宋体", 0, 12));
    jMenuHouseManager.setFocusPainted(true);
    jMenuHouseManager.setText("房产管理");
    jMItemBuildInfo.setBackground(SystemColor.controlHighlight);
    jMItemBuildInfo.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemBuildInfo.setText("房产信息维护");
    jMItemBuildInfo.addActionListener(new
                                      MainMenu_jMItemBuildInfo_actionAdapter(this));
    jMItemCodeSet.setBackground(SystemColor.controlHighlight);
    jMItemCodeSet.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemCodeSet.setText("代码表设置");
    jMItemCodeSet.addActionListener(new MainMenu_jMItemCodeSet_actionAdapter(this));
    jMenuSystem.addSeparator();
    jMenuBar.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemHouseInfo.setBackground(SystemColor.controlHighlight);
    jMItemHouseInfo.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemHouseInfo.setText("住房信息维护");
    jMItemHouseInfo.addActionListener(new
                                      MainMenu_jMItemHouseInfo_actionAdapter(this));
    jMenuOwner.setBackground(SystemColor.controlHighlight);
    jMenuOwner.setFont(new java.awt.Font("宋体", 0, 12));
    jMenuOwner.setText("住户管理");
    jMItemBasicInfo.setBackground(SystemColor.controlHighlight);
    jMItemBasicInfo.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemBasicInfo.setToolTipText("");
    jMItemBasicInfo.setText("基本信息维护");
    jMItemBasicInfo.addActionListener(new
                                      MainMenu_jMItemBasicInfo_actionAdapter(this));
    jMItemFamilyInfo.setBackground(SystemColor.controlHighlight);
    jMItemFamilyInfo.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemFamilyInfo.setText("家庭信息维护");
    jMItemFamilyInfo.addActionListener(new
                                       MainMenu_jMItemFamilyInfo_actionAdapter(this));
    jMenuQuery.setFont(new java.awt.Font("宋体", 0, 12));
    jMenuQuery.setText("查询");
    jMItemHouseQuery.setBackground(SystemColor.controlHighlight);
    jMItemHouseQuery.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemHouseQuery.setText("房产信息查询");
    jMItemHouseQuery.addActionListener(new
                                       MainMenu_jMItemHouseQuery_actionAdapter(this));
    jMItemOwnerQuery.setBackground(SystemColor.controlHighlight);
    jMItemOwnerQuery.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemOwnerQuery.setText("住户信息查询");
    jMItemOwnerQuery.addActionListener(new
                                       MainMenu_jMItemOwnerQuery_actionAdapter(this));
    jMItemComboQuery.setFont(new java.awt.Font("宋体", 0, 12));
    jMItemComboQuery.setText("组合查询");
    jMItemComboQuery.addActionListener(new
                                       MainMenu_jMItemComboQuery_actionAdapter(this));
    jMenuSystem.add(jMItemCodeSet);
    jMenuSystem.addSeparator();
    jMenuSystem.add(jMItemExit);
    jMenuHouseManager.add(jMItemBuildInfo);
    jMenuHouseManager.add(jMItemHouseInfo);
    jMenuBar.add(jMenuSystem);
    jMenuBar.add(jMenuHouseManager);
    jMenuBar.add(jMenuOwner);
    jMenuBar.add(jMenuQuery);
    jMenuOwner.add(jMItemBasicInfo);
    jMenuOwner.add(jMItemFamilyInfo);
    jMenuQuery.add(jMItemHouseQuery);
    jMenuQuery.add(jMItemOwnerQuery);
    jMenuQuery.addSeparator();
    jMenuQuery.add(jMItemComboQuery);
    this.setJMenuBar(jMenuBar);

  }

  void jMItemCodeSet_actionPerformed(ActionEvent e) {
    CodeSet codeSet = new CodeSet();
    Dimension dlgSize = codeSet.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    codeSet.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                        (frmSize.height - dlgSize.height) / 2 + loc.y);
    codeSet.pack();
    codeSet.show();

  }

  void jMItemExit_actionPerformed(ActionEvent e) {
    System.exit(0);
  }

  void jMItemBuildInfo_actionPerformed(ActionEvent e) {
    BuildInfo buildInfo = new BuildInfo();
    Dimension dlgSize = buildInfo.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    buildInfo.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                          (frmSize.height - dlgSize.height) / 2 + loc.y);
    buildInfo.pack();
    buildInfo.show();

  }

  void jMItemHouseInfo_actionPerformed(ActionEvent e) {
    HouseInfo houseInfo = new HouseInfo();
    Dimension dlgSize = houseInfo.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    houseInfo.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                          (frmSize.height - dlgSize.height) / 2 + loc.y);
    houseInfo.pack();
    houseInfo.show();

  }

  void jMItemBasicInfo_actionPerformed(ActionEvent e) {
    OwnerInfo ownerInfo = new OwnerInfo();
    Dimension dlgSize = ownerInfo.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    ownerInfo.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                          (frmSize.height - dlgSize.height) / 2 + loc.y);
    ownerInfo.pack();
    ownerInfo.show();

  }

  void jMItemFamilyInfo_actionPerformed(ActionEvent e) {
    FamilyInfo familyInfo = new FamilyInfo();
    Dimension dlgSize = familyInfo.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    familyInfo.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                           (frmSize.height - dlgSize.height) / 2 + loc.y);
    familyInfo.pack();
    familyInfo.show();

  }

  void jMItemHouseQuery_actionPerformed(ActionEvent e) {
    HouseQuery houseQuery = new HouseQuery();
    Dimension dlgSize = houseQuery.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    houseQuery.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                           (frmSize.height - dlgSize.height) / 2 + loc.y);
    houseQuery.pack();
    houseQuery.show();

  }

  void jMItemOwnerQuery_actionPerformed(ActionEvent e) {
    OwnerQuery ownerQuery = new OwnerQuery();
    Dimension dlgSize = ownerQuery.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    ownerQuery.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,
                           (frmSize.height - dlgSize.height) / 2 + loc.y);
    ownerQuery.pack();
    ownerQuery.show();

  }

  void jMItemComboQuery_actionPerformed(ActionEvent e) {

  }

}

class MainMenu_jMItemCodeSet_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemCodeSet_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemCodeSet_actionPerformed(e);
  }
}

class MainMenu_jMItemExit_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemExit_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemExit_actionPerformed(e);
  }
}

class MainMenu_jMItemBuildInfo_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemBuildInfo_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemBuildInfo_actionPerformed(e);
  }
}

class MainMenu_jMItemHouseInfo_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemHouseInfo_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemHouseInfo_actionPerformed(e);
  }
}

class MainMenu_jMItemBasicInfo_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemBasicInfo_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemBasicInfo_actionPerformed(e);
  }
}

class MainMenu_jMItemFamilyInfo_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemFamilyInfo_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemFamilyInfo_actionPerformed(e);
  }
}

class MainMenu_jMItemHouseQuery_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemHouseQuery_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemHouseQuery_actionPerformed(e);
  }
}

class MainMenu_jMItemOwnerQuery_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemOwnerQuery_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemOwnerQuery_actionPerformed(e);
  }
}

class MainMenu_jMItemComboQuery_actionAdapter
    implements java.awt.event.ActionListener {
  MainMenu adaptee;

  MainMenu_jMItemComboQuery_actionAdapter(MainMenu adaptee) {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e) {
    adaptee.jMItemComboQuery_actionPerformed(e);
  }
}

⌨️ 快捷键说明

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