public class QueryOrderForm extends JDialog { private int testQuery =0 ;
private JPanel jPanel1 = new JPanel();
private XYLayout xYLayout1 = new XYLayout(); private JLabel jLabel1 = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel4 = new JLabel();
private JTextField jTextField1 = new JTextField(); private JTextField jTextField2 = new JTextField(); private JTextField jTextField3 = new JTextField(); private JTextField jTextField4 = new JTextField(); private JButton jButton1 = new JButton(); private JButton jButton2 = new JButton(); private JButton jButton3 = new JButton(); private JButton jButton4 = new JButton(); private JButton jButton5 = new JButton();
public QueryOrderForm(Frame frame, String title, boolean modal) { super(frame, title, modal); try {
jbInit(); pack(); }
catch(Exception ex) { ex.printStackTrace(); } }
public QueryOrderForm() { this(null, \ }
private void jbInit() throws Exception { jPanel1.setLayout(xYLayout1); jLabel1.setText(\订货商品名称\ jLabel2.setText(\订货厂商\ jLabel3.setText(\订货日期\ jLabel4.setText(\订货状态\ jButton1.setText(\查询\
jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } });
jButton2.setText(\查询\
jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } });
jButton3.setText(\查询\
jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton3_actionPerformed(e); } });
jButton4.setText(\查询\
jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton4_actionPerformed(e); } });
jButton5.setText(\退出\
jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton5_actionPerformed(e); } });
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jTextField1, new XYConstraints(122, 20, 110, 24)); jPanel1.add(jTextField4, new XYConstraints(122, 156, 109, 25)); jPanel1.add(jButton1, new XYConstraints(281, 20, 61, 23)); jPanel1.add(jButton3, new XYConstraints(282, 112, 60, 21)); jPanel1.add(jButton4, new XYConstraints(283, 156, 60, 21)); jPanel1.add(jButton2, new XYConstraints(281, 65, 61, 22)); jPanel1.add(jLabel1, new XYConstraints(28, 20, 92, 24));
jPanel1.add(jTextField2, new XYConstraints(122, 65, 111, 25)); jPanel1.add(jLabel3, new XYConstraints(28, 112, 92, 24));
jPanel1.add(jTextField3, new XYConstraints(122, 112, 111, 25)); jPanel1.add(jLabel4, new XYConstraints(28, 156, 96, 24)); jPanel1.add(jLabel2, new XYConstraints(28, 65, 95, 26)); jPanel1.add(jButton5, new XYConstraints(291, 205, 75, 22)); }
public void cancel(){ dispose() ; }
void jButton1_actionPerformed(ActionEvent e) { testQuery = 1 ;
cancel() ; }
//cancel
void jButton5_actionPerformed(ActionEvent e) { cancel() ; }
void jButton2_actionPerformed(ActionEvent e) { testQuery = 2 ; cancel() ; }
void jButton3_actionPerformed(ActionEvent e) { testQuery = 3 ; cancel() ; }
void jButton4_actionPerformed(ActionEvent e) { testQuery = 4 ; cancel() ; }
public String getBuyerGoodsName(){ return jTextField1.getText( ) ; }
public String getBuyerManufacturer(){ return jTextField2.getText() ; }
public String getBuyerDate(){ return jTextField3.getText() ; }
public String getBuyerStatus(){ return jTextField4.getText() ; }
public int gettestQuery(){ return testQuery ; } }
1. Logincs.java
package uml_gaokai;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*; import java.awt.event.*;
import com.borland.dx.sql.dataset.*; import java.sql.*;
import javax.swing.border.*;
public class Logincs extends JDialog implements ActionListener{ private JPanel panel1 = new JPanel();
private BorderLayout borderLayout1 = new BorderLayout(); private JPanel jPanel1 = new JPanel();
private XYLayout xYLayout1 = new XYLayout(); private JLabel jLabel1 = new JLabel(); private JLabel jLabel2 = new JLabel();
private JTextField jTextField1 = new JTextField(); private JButton jButton1 = new JButton(); private JButton jButton2 = new JButton();
private JPasswordField jPasswordField1 = new JPasswordField(); private Database database1 = new Database();
private QueryDataSet queryDataSet1 = new QueryDataSet(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel4 = new JLabel(); private JLabel jLabel5 = new JLabel(); private TitledBorder titledBorder1; private TitledBorder titledBorder2; private JLabel jLabel6 = new JLabel();
public Logincs(Frame frame, String title, boolean modal) { super(frame, title, modal); try {
jbInit(); pack(); }
catch(Exception ex) { ex.printStackTrace(); } }
public Logincs() { this(null, \ }
private void jbInit() throws Exception { titledBorder1 = new TitledBorder(\ titledBorder2 = new TitledBorder(\ panel1.setLayout(borderLayout1);
jPanel1.setLayout(xYLayout1);
jLabel1.setForeground(Color.blue);//标签控件的字体颜色 jLabel1.setText(\用户名\标签标题 jLabel2.setForeground(Color.blue);
jLabel2.setText(\密码\
jButton1.setForeground(UIManager.getColor(\按钮控件字体颜色
jButton1.setBorder(BorderFactory.createRaisedBevelBorder());//按钮外观 jButton1.setText(\登录\按钮标题
jButton1.addActionListener(this);//加入按钮事件
jButton2.setForeground(UIManager.getColor(\ jButton2.setBorder(BorderFactory.createRaisedBevelBorder()); jButton2.setToolTipText(\
jButton2.setText(\取消\
jButton2.addActionListener(this);
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setMinimumSize(new Dimension(600, 600));//设置面板大小 jPanel1.setPreferredSize(new Dimension(400, 300)); jPasswordField1.setBorder(titledBorder1); jPasswordField1.setToolTipText(\ database1.setConnection(new
com.borland.dx.sql.dataset.ConnectionDescriptor(\\
queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, \ \ this.setResizable(false); this.setTitle(\
jLabel3.setBackground(Color.white);//标签背景颜色 jLabel3.setForeground(Color.green);
jLabel3.setBorder(BorderFactory.createEtchedBorder());
jLabel3.setText(\ 小型超市管理系统\ jLabel4.setBorder(BorderFactory.createEtchedBorder()); jLabel4.setText(\——制作人:高凯\
jLabel5.setBorder(BorderFactory.createEtchedBorder()); jLabel5.setToolTipText(\
jLabel5.setText(\——版本号: 1.1\ jTextField1.setBorder(titledBorder2);
jLabel6.setBorder(BorderFactory.createEtchedBorder()); getContentPane().add(panel1);
panel1.add(jPanel1, BorderLayout.WEST);
jPanel1.add(jLabel3, new XYConstraints(-1, 0, 395, 30)); jPanel1.add(jLabel5, new XYConstraints(274, 30, 121, 32)); jPanel1.add(jLabel4, new XYConstraints(127, 32, 143, 30));
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库销售管理系统案例(4)在线全文阅读。
相关推荐: