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

📄 frame2.java

📁 基于Java的物流管理系统的开发与应用
💻 JAVA
字号:
package untitled5;import java.io.*;import java.net.*;import java.sql.*;import java.lang.*;import javax.sql.*;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;import com.borland.dbswing.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author not attributable * @version 1.0 *///货品信息登记public class Frame2 extends JFrame {  JPanel contentPane;  JLabel jLabel1 = new JLabel();  XYLayout xYLayout1 = new XYLayout();  JLabel jLabel2 = new JLabel();  JLabel jLabel3 = new JLabel();  JLabel jLabel4 = new JLabel();  JLabel jLabel5 = new JLabel();  JLabel jLabel6 = new JLabel();  JLabel jLabel7 = new JLabel();  JTextField jTextField1 = new JTextField();  JTextField jTextField2 = new JTextField();  JTextField jTextField3 = new JTextField();  JTextField jTextField4 = new JTextField();  JTextField jTextField5 = new JTextField();  JLabel jLabel8 = new JLabel();  JTextField jTextField6 = new JTextField();  JLabel jLabel9 = new JLabel();  JTextField jTextField7 = new JTextField();  JLabel jLabel10 = new JLabel();  JTextField jTextField8 = new JTextField();  JLabel jLabel11 = new JLabel();  JTextField jTextField9 = new JTextField();  JButton jButton1 = new JButton();  //Construct the frame  public Frame2() {    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(xYLayout1);    this.setSize(new Dimension(600, 500));    this.setTitle("物流管理系统");    this.addHierarchyBoundsListener(new Frame2_this_hierarchyBoundsAdapter(this));    jLabel1.setFont(new java.awt.Font("SansSerif", 0, 25));    jLabel1.setForeground(Color.red);    jLabel1.setText("物流管理系统");    contentPane.setBackground(UIManager.getColor("Desktop.background"));    contentPane.setForeground(Color.black);    jLabel2.setFont(new java.awt.Font("SansSerif", 0, 30));    jLabel2.setText("货 物 信 息 登 记");    jLabel3.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel3.setText("货物编码");    jLabel4.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel4.setRequestFocusEnabled(true);    jLabel4.setText("类      别");    jLabel5.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel5.setText("仓库编码");   // statusBar.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel6.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel6.setText("入库计划单价");    jLabel7.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel7.setText("原始库存量");    jTextField1.setText("");    jTextField2.setText("");    jTextField3.setText("");    jTextField4.setText("");    jTextField5.setText("");    jLabel8.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel8.setText("货品规格名称");    jTextField6.setText("");    jLabel9.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel9.setText("等            级");    jTextField7.addActionListener(new Frame2_jTextField7_actionAdapter(this));    jLabel10.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel10.setText("存  放  仓  库");    jTextField7.setText("");    jTextField8.setText("");    jLabel11.setFont(new java.awt.Font("SansSerif", 0, 20));    jLabel11.setText("原始库存件数");    jTextField9.addActionListener(new Frame2_jTextField9_actionAdapter(this));    jButton1.setFont(new java.awt.Font("SansSerif", 0, 20));    jButton1.setText("提交");    jButton1.addActionListener(new Frame2_jButton1_actionAdapter(this));    contentPane.add(jLabel1, new XYConstraints(237, 0, 153, 40));    contentPane.add(jLabel2, new XYConstraints(200, 47, 231, 58));    contentPane.add(jLabel3,    new XYConstraints(60, 125, -1, -1));    contentPane.add(jLabel5,  new XYConstraints(60, 249, -1, -1));    contentPane.add(jLabel4, new XYConstraints(64, 190, -1, 26));    contentPane.add(jTextField1,      new XYConstraints(145, 128, 106, 28));    contentPane.add(jTextField2,       new XYConstraints(144, 191, 108, 29));    contentPane.add(jTextField3,       new XYConstraints(144, 251, 111, 29));    contentPane.add(jLabel6, new XYConstraints(22, 311, -1, -1));    contentPane.add(jTextField4,   new XYConstraints(144, 314, 113, 28));    contentPane.add(jLabel7,    new XYConstraints(41, 364, -1, 30));    contentPane.add(jTextField5,        new XYConstraints(143, 368, 114, 30));    contentPane.add(jLabel8,     new XYConstraints(277, 127, -1, -1));    contentPane.add(jTextField6,     new XYConstraints(400, 130, 143, 26));    contentPane.add(jLabel9, new XYConstraints(279, 189, -1, -1));    contentPane.add(jTextField7, new XYConstraints(397, 189, 143, 30));    contentPane.add(jLabel10,  new XYConstraints(278, 260, -1, -1));    contentPane.add(jTextField8,       new XYConstraints(401, 259, 141, 32));    contentPane.add(jLabel11,    new XYConstraints(279, 314, -1, -1));    contentPane.add(jTextField9,     new XYConstraints(403, 315, 142, 30));    contentPane.add(jButton1,             new XYConstraints(404, 361, 109, 34));  }  //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 jPasswordField1_actionPerformed(ActionEvent e) {      //   validID();    }  void validID() {   try {     String str1, str2,str3,str4,str5,str6,str7,str8,str9;     str1 = jTextField1.getText();     str2 = jTextField2.getText();     str3 = jTextField3.getText();     str4 = jTextField4.getText();     str5 = jTextField5.getText();     str6 = jTextField6.getText();     str7 = jTextField7.getText();     str8 = jTextField8.getText();     str9 = jTextField9.getText();     //装载jdbc驱动程序     String driverName = "oracle.jdbc.OracleDriver";     Driver driver = (Driver) Class.forName(driverName).newInstance();     //连接数据库     Connection con = DriverManager.getConnection(         "jdbc:oracle:thin:@thsspc0791:1521:tongfang", "sa", "tongfang");     PreparedStatement pstmt = con.prepareStatement(         " insert into Good-Info('goodnumber','kind' ,'warenumber','wareprice','originateNumber','name','class','ware','oriMount')values(?,?,?,?,?,?,?,?,?)");     pstmt.setString(1, str1);     pstmt.setString(2, str2);     pstmt.setString(3, str3);     pstmt.setString(4, str4);     pstmt.setString(5, str5);     pstmt.setString(6, str6);     pstmt.setString(7, str7);     pstmt.setString(8, str8);     pstmt.setString(9, str9);     ResultSet res = pstmt.executeQuery();     //String sa=res.getString(1);      pstmt.close();     con.close();   }catch (InstantiationException e) {     System.out.println(e.getMessage());   }catch (IllegalAccessException e) {     System.out.println(e.getMessage());   }catch (ClassNotFoundException e) {     System.out.println(e.getMessage());   }catch (SQLException edd) {     edd.printStackTrace() ;     System.out.println(edd.getMessage());   } }  void jTextField7_actionPerformed(ActionEvent e) {  }  void jTextField9_actionPerformed(ActionEvent e) {  }  void jButton1_actionPerformed(ActionEvent e) {    validID();  }  void this_ancestorMoved(HierarchyEvent e) {  }}class Frame2_jTextField7_actionAdapter implements java.awt.event.ActionListener {  Frame2 adaptee;  Frame2_jTextField7_actionAdapter(Frame2 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jTextField7_actionPerformed(e);  }}class Frame2_jTextField9_actionAdapter implements java.awt.event.ActionListener {  Frame2 adaptee;  Frame2_jTextField9_actionAdapter(Frame2 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jTextField9_actionPerformed(e);  }}class Frame2_jButton1_actionAdapter implements java.awt.event.ActionListener {  Frame2 adaptee;  Frame2_jButton1_actionAdapter(Frame2 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}class Frame2_this_hierarchyBoundsAdapter extends java.awt.event.HierarchyBoundsAdapter {  Frame2 adaptee;  Frame2_this_hierarchyBoundsAdapter(Frame2 adaptee) {    this.adaptee = adaptee;  }  public void ancestorMoved(HierarchyEvent e) {    adaptee.this_ancestorMoved(e);  }}

⌨️ 快捷键说明

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