java水果超市的代码 java水果店代码( 三 )


JLabel jLabel5 = new JLabel();
JTextField jTextField3 = new JTextField();
//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.setForeground(Color.black);
jLabel2.setFont(new java.awt.Font("SansSerif", 0, 30));
jLabel2.setText("产 品 信 息 展 示");
// statusBar.setFont(new java.awt.Font("SansSerif", 0, 20));
jLabel3.setFont(new java.awt.Font("SansSerif", 0, 20));
jLabel3.setText("产品名称");
jTextField1.setText("");
jLabel4.setEnabled(true);
jLabel4.setFont(new java.awt.Font("SansSerif", 0, 20));
jLabel4.setText("产品ID号");
jTextField2.setText("");
jTextField2.addActionListener(new Frame2_jTextField2_actionAdapter(this));
jPanel1.setLayout(xYLayout2);
jLabel5.setFont(new java.awt.Font("SansSerif", 0, 25));
jLabel5.setForeground(Color.red);
jLabel5.setText("该产品详细信息");
jTextField3.setText("");
contentPane.add(jLabel1, new XYConstraints(237, 0, 153, 40));
contentPane.add(jLabel2, new XYConstraints(200, 47, 231, 58));
contentPane.add(jLabel3, new XYConstraints(47, 102, 101, 42));
contentPane.add(jTextField1, new XYConstraints(128, 108, 112, 34));
contentPane.add(jTextField2, new XYConstraints(361, 107, 109, 36));
contentPane.add(jPanel1, new XYConstraints(75, 166, 453, 277));
jPanel1.add(jScrollPane1, new XYConstraints(14, 8, 433, 221));
jScrollPane1.getViewport().add(jTextField3, null);
jPanel1.add(jLabel5, new XYConstraints(112, 240, -1, -1));
contentPane.add(jLabel4, new XYConstraints(278, 111, -1, -1));
}
//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 Select() {
try {
String str1, str2;
str1 = jTextField1.getText();
str2 = jTextField2.getText();
java超市管理系统源代码只写个demo级的例程很好写 , 但用到生产环境中还得具体分析设计再编码 。这种代码网上太多了内,你随便搜下就有了 。
java超市计价系统代码package entity;
public class Market {
private int id;//id
private int num;//数量
private String goods;//商品
private double price;//价格

public Market(int id, int num, String goods, double price) {
super();
this.id = id;
this.num = num;
this.goods = goods;
this.price = price;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
【java水果超市的代码 java水果店代码】 }
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getGoods() {
return goods;
}
public void setGoods(String goods) {
this.goods = goods;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double calc( ){
double sum=price*num;
System.out.println("您消费共计:"+sum+"¥");

推荐阅读