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

📄 txlframe.java

📁 swing界面,适合入门人士
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    clmnQemail.setServerColumnName("email");
    clmnQemail.setSqlType(12);
    clmnQmobile.setCaption("手机");
    clmnQmobile.setColumnName("mobile");
    clmnQmobile.setDataType(com.borland.dx.dataset.Variant.STRING);
    clmnQmobile.setPrecision(20);
    clmnQmobile.setTableName("txl");
    clmnQmobile.setServerColumnName("mobile");
    clmnQmobile.setSqlType(12);
    clmnQworkphone.setCaption("公司电话");
    clmnQworkphone.setColumnName("workphone");
    clmnQworkphone.setDataType(com.borland.dx.dataset.Variant.STRING);
    clmnQworkphone.setPrecision(20);
    clmnQworkphone.setTableName("txl");
    clmnQworkphone.setServerColumnName("workphone");
    clmnQworkphone.setSqlType(12);
    clmnQhomephone.setCaption("家庭电话");
    clmnQhomephone.setColumnName("homephone");
    clmnQhomephone.setDataType(com.borland.dx.dataset.Variant.STRING);
    clmnQhomephone.setPrecision(20);
    clmnQhomephone.setTableName("txl");
    clmnQhomephone.setServerColumnName("homephone");
    clmnQhomephone.setSqlType(12);
    clmnQpager.setCaption("呼机");
    clmnQpager.setColumnName("pager");
    clmnQpager.setDataType(com.borland.dx.dataset.Variant.STRING);
    clmnQpager.setPrecision(16);
    clmnQpager.setTableName("txl");
    clmnQpager.setServerColumnName("pager");
    clmnQpager.setSqlType(12);
    jpnlQuickView.addComponentListener(new java.awt.event.ComponentAdapter() {
      public void componentShown(ComponentEvent e) {
        jpnlQuickView_componentShown(e);
      }
    });
    jmnbrMain.add(jmnDatabase);
    jmnbrMain.add(jmnCaoZuo);
    jmnbrMain.add(jmnStyle);
    jmnDatabase.add(jrdbtnmnitmRead);
    jmnDatabase.add(jrdbtnmnitmReadWrite);
    jmnDatabase.addSeparator();
    jmnDatabase.add(jmnitmExit);
    cntntpnTab.add(jtbdpnView,  BorderLayout.CENTER);
    jtbdpnView.add(jpnlTableView,    "表格视图");
    jtbdpnView.add(jpnlFormView,   "表单视图");
    jtbdpnView.add(jpnlQuickView,   "快速视图");
    jpnlTableView.add(tblscrlpnTableView, BorderLayout.CENTER);
    jpnlTableView.add(jdbnvtlbrTableView,  BorderLayout.SOUTH);

    tblscrlpnTableView.getViewport().add(jdbtblTableView, null);
    jpnlFormView.add(jpnlFormUpView, BorderLayout.CENTER);
    jpnlFormView.add(jdbnvtlbrFormView,  BorderLayout.SOUTH);
    jpnlQuickView.add(jspltpnQuickView,  BorderLayout.CENTER);
    jspltpnQuickView.add(tblscrlpnQuickViewLeft, JSplitPane.LEFT);
    jspltpnQuickView.add(tblscrlpneQuickViewRight, JSplitPane.RIGHT);
    jpnlQuickView.add(jdbnvtlbrQuickView, BorderLayout.NORTH);
    tblscrlpneQuickViewRight.getViewport().add(jdbtblQuickViewRight, null);
    tblscrlpnQuickViewLeft.getViewport().add(jdbtblQuickViewLeft, null);
    jmnCaoZuo.add(jmnitmChaZhao);
    jmnCaoZuo.add(jmnitmCanclefind);
    jmnStyle.add(jchckbxmntmWin);
    jmnStyle.add(jchckbxmntmJava);
    jmnStyle.add(jchckbxmntmMac);
    jpnlFormUpView.add(jlblXingming,  new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(25, 81, 0, 24), 0, 0));
    jpnlFormUpView.add(jlblXingbie,  new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(89, 81, 0, 24), 0, 0));
    jpnlFormUpView.add(jlblCompany,  new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(89, 81, 0, 24), 0, 0));
    jpnlFormUpView.add(jlblHomephone,  new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(91, 81, 0, 0), 0, 0));
    jpnlFormUpView.add(jdbtxtfldHomephone,  new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(91, 41, 0, 0), 45, 0));
    jpnlFormUpView.add(jdbtxtfldXingming,  new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(25, 41, 0, 0), 45, 0));
    jpnlFormUpView.add(jdbtxtfldXingbie,  new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(89, 41, 0, 0), 45, 0));
    jpnlFormUpView.add(jdbtxtfldCompany,  new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(89, 41, 0, 0), 45, 0));
    jpnlFormUpView.add(jdbtxtfldMobile,  new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(97, 41, 1, 0), 45, 0));
    jpnlFormUpView.add(jlblMobile,  new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(99, 81, 1, 24), 0, 0));
    jpnlFormUpView.add(jdbtxtfldEmail,  new GridBagConstraints(3, 3, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(91, 47, 0, 71), 46, 0));
    jpnlFormUpView.add(jlblEmail,  new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(91, 146, 0, 16), 0, 0));
    jpnlFormUpView.add(jlblWorkphone,  new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(89, 146, 0, 0), 0, 0));
    jpnlFormUpView.add(jlblPager,  new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(89, 146, 0, 24), 0, 0));
    jpnlFormUpView.add(jlblGuanxi,  new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(25, 146, 0, 24), 0, 0));
    jpnlFormUpView.add(jdbtxtfldGuanxi,  new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(25, 32, 0, 86), 46, 0));
    jpnlFormUpView.add(jdbtxtfldWorkphone,  new GridBagConstraints(3, 2, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(89, 38, 0, 80), 46, 0));
    jpnlFormUpView.add(jdbtxtfldPager,  new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0
            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(89, 38, 0, 80), 46, 0));
    qrydtstQuickView.setMasterLink(new com.borland.dx.dataset.MasterLinkDescriptor(qrydtstShuXing, new String[] {"shuxing"}, new String[] {"guanxi"}, false, false, false));
    jspltpnQuickView.setDividerLocation(100);
    qrydtstMainView.setColumns(new Column[] {clmnXingming, clmnXingbie, clmnGuanxi, clmnCompany, clmnMobile, clmnHomephone, clmnEmail, clmnPager, clmnWorkphone});
    qrydtstShuXing.setColumns(new Column[] {clmnShuxing});
    qrydtstQuickView.setColumns(new Column[] {clmnQxingming, clmnQxingbie, clmnQcompany, clmnQemail, clmnQmobile, clmnQworkphone, clmnQhomephone, clmnQpager});


//jpnlFormView.add(jdbnvtlbrTableForm, BorderLayout.SOUTH);
  }
  //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 jmnitmChaZhao_actionPerformed(ActionEvent e) {
    dlgChaZhao mydlg=new dlgChaZhao();
    mydlg.setModal(true);
    mydlg.centerPosition(mydlg);
    mydlg.show();

   if (mydlg.getStatus()==0) {
     return;
   }
  String column=mydlg.getColumn();
  String data=mydlg.getData();
  if (qrydtstMainView.isOpen()) {
    qrydtstMainView.close();
  }
  qrydtstMainView.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(dtbsTxl, "select * from \"txl\""+"where"+"\""+mydlg.getColumn()+"\""+"="+"'"+mydlg.getData()+"'", null, true, Load.ALL));
  qrydtstMainView.open();
  jmnitmCanclefind.setEnabled(true);



}

private String column;
private String data;
  JMenu jmnStyle = new JMenu();
  JCheckBoxMenuItem jchckbxmntmWin = new JCheckBoxMenuItem();
  JCheckBoxMenuItem jchckbxmntmJava = new JCheckBoxMenuItem();
  JCheckBoxMenuItem jchckbxmntmMac = new JCheckBoxMenuItem();
  JMenuItem jmnitmCanclefind = new JMenuItem();
  Column clmnXingbie = new Column();
  Column clmnCompany = new Column();
  Column clmnMobile = new Column();
  Column clmnHomephone = new Column();
  Column clmnEmail = new Column();
  Column clmnPager = new Column();
  JdbTextField jdbtxtfldXingbie = new JdbTextField();
  JdbTextField jdbtxtfldCompany = new JdbTextField();
  JdbTextField jdbtxtfldHomephone = new JdbTextField();
  JdbTextField jdbtxtfldMobile = new JdbTextField();
  JdbTextField jdbtxtfldEmail = new JdbTextField();
  JdbTextField jdbtxtfldPager = new JdbTextField();
  JdbTextField jdbtxtfldWorkphone = new JdbTextField();
  Column clmnWorkphone = new Column();
  JLabel jlblXingming = new JLabel();
  JLabel jlblXingbie = new JLabel();
  JLabel jlblCompany = new JLabel();
  JLabel jlblHomephone = new JLabel();
  JLabel jlblMobile = new JLabel();
  JLabel jlblGuanxi = new JLabel();
  JLabel jlblPager = new JLabel();
  JLabel jlblWorkphone = new JLabel();
  JLabel jlblEmail = new JLabel();
  JdbTextField jdbtxtfldGuanxi = new JdbTextField();
  Column clmnShuxing = new Column();
  Column clmnQxingming = new Column();
  Column clmnQxingbie = new Column();
  Column clmnQcompany = new Column();
  Column clmnQemail = new Column();
  Column clmnQmobile = new Column();
  Column clmnQworkphone = new Column();
  Column clmnQhomephone = new Column();
  Column clmnQpager = new Column();
  GridBagLayout gridBagLayout1 = new GridBagLayout();

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


  void jchckbxmntmWin_actionPerformed(ActionEvent e) {
   try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    SwingUtilities.updateComponentTreeUI(this);

   }
   catch (Exception ex) {
     ex.printStackTrace();
   }

    jchckbxmntmWin.setSelected(true);
    jchckbxmntmJava.setSelected(false);
    jchckbxmntmMac.setSelected(false);

  }

  void jchckbxmntmJava_actionPerformed(ActionEvent e) {

    try {
    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    SwingUtilities.updateComponentTreeUI(this);
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
    jchckbxmntmWin.setSelected(false);
    jchckbxmntmJava.setSelected(true);
    jchckbxmntmMac.setSelected(false);

  }

  void jchckbxmntmMac_actionPerformed(ActionEvent e) {
        try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    SwingUtilities.updateComponentTreeUI(this);

    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
    jchckbxmntmWin.setSelected(false);
    jchckbxmntmJava.setSelected(false);
    jchckbxmntmMac.setSelected(true);
  }

  void jmnitmCanclefind_actionPerformed(ActionEvent e) {
    if (qrydtstMainView.isOpen()) {
    qrydtstMainView.close();
    }
    qrydtstMainView.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(dtbsTxl, "select * from \"txl\"", null, true, Load.ALL));
    qrydtstMainView.open();
    jmnitmCanclefind.setEnabled(false);
    }

  void jrdbtnmnitmReadWrite_actionPerformed(ActionEvent e) {
   qrydtstMainView.setEditable(true);
   jrdbtnmnitmRead.setSelected(false);
   jrdbtnmnitmReadWrite.setSelected(true);
  }

  void jrdbtnmnitmRead_actionPerformed(ActionEvent e) {
    qrydtstMainView.setEditable(false);
    jrdbtnmnitmRead.setSelected(true);
    jrdbtnmnitmReadWrite.setSelected(false);

  }

  void jdbtxtfldEmail_actionPerformed(ActionEvent e) {

  }

  void jpnlQuickView_componentShown(ComponentEvent e) {
    qrydtstQuickView.refresh();
  }
}

⌨️ 快捷键说明

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