急求解决!!java!!
找个这个例子写一个程序,我帮朋友做的。谢谢大家了!importjavax.swing.*;importjava.awt.*;publicclassCustomerexte...
找个这个例子写一个程序,我帮朋友做的。
谢谢大家了!
import javax.swing.*;
import java.awt.*;
public class Customer extends JFrame{
JTextField textField1,textField2,textField4;
JLabel label1,label2,label3,label4;
//JList list;
JComboBox comboBox;
String[] packAges={"Executive","Aaaaaa","Bbbbbbb","Ccccccc"};
JPanel panel;
public Customer(){
super("Customer");
Container container=getContentPane();
this.setLayout(null);
label1=new JLabel("Customer Name:");
textField1=new JTextField(20);
label2=new JLabel("Cell Number:");
textField2=new JTextField(10);
label3=new JLabel("Package:");
//list=new JList(packAges);
comboBox=new JComboBox(packAges);
//comboBox.setSelectedIndex(4);
label4=new JLabel("Age:");
textField4=new JTextField(2);
label1.setBounds(new Rectangle(70,120,100,20));
textField1.setBounds(new Rectangle(165,120,300,20));
label2.setBounds(new Rectangle(70,142,100,20));
textField2.setBounds(new Rectangle(165,142,150,20));
label3.setBounds(new Rectangle(70,164,100,20));
comboBox.setBounds(new Rectangle(165,164,130,20));
label4.setBounds(new Rectangle(70,186,100,20));
textField4.setBounds(new Rectangle(165,186,50,20));
container.add(label1);
container.add(textField1);
container.add(label2);
container.add(textField2);
container.add(label3);
container.add(comboBox);
container.add(label4);
container.add(textField4);
setSize(500,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
// pack();
}
public static void main(String[] args)
{new Customer();}
}
尽快了!!好的话再加分了.....
晕!!!
照这个程序写个商品类,能够实现商品的添加。
要求有图形界面。
商品添加的内容有:商品名称,价格,牌子,生产厂家。
能够实现添加就行,不用再弄到数据库了。 展开
谢谢大家了!
import javax.swing.*;
import java.awt.*;
public class Customer extends JFrame{
JTextField textField1,textField2,textField4;
JLabel label1,label2,label3,label4;
//JList list;
JComboBox comboBox;
String[] packAges={"Executive","Aaaaaa","Bbbbbbb","Ccccccc"};
JPanel panel;
public Customer(){
super("Customer");
Container container=getContentPane();
this.setLayout(null);
label1=new JLabel("Customer Name:");
textField1=new JTextField(20);
label2=new JLabel("Cell Number:");
textField2=new JTextField(10);
label3=new JLabel("Package:");
//list=new JList(packAges);
comboBox=new JComboBox(packAges);
//comboBox.setSelectedIndex(4);
label4=new JLabel("Age:");
textField4=new JTextField(2);
label1.setBounds(new Rectangle(70,120,100,20));
textField1.setBounds(new Rectangle(165,120,300,20));
label2.setBounds(new Rectangle(70,142,100,20));
textField2.setBounds(new Rectangle(165,142,150,20));
label3.setBounds(new Rectangle(70,164,100,20));
comboBox.setBounds(new Rectangle(165,164,130,20));
label4.setBounds(new Rectangle(70,186,100,20));
textField4.setBounds(new Rectangle(165,186,50,20));
container.add(label1);
container.add(textField1);
container.add(label2);
container.add(textField2);
container.add(label3);
container.add(comboBox);
container.add(label4);
container.add(textField4);
setSize(500,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
// pack();
}
public static void main(String[] args)
{new Customer();}
}
尽快了!!好的话再加分了.....
晕!!!
照这个程序写个商品类,能够实现商品的添加。
要求有图形界面。
商品添加的内容有:商品名称,价格,牌子,生产厂家。
能够实现添加就行,不用再弄到数据库了。 展开
展开全部
import javax.swing.*;
import java.awt.*;
public class Commodity extends JFrame{
JTextField textField1,textField2,textField3;
JLabel label1,label2,label3,label4;
JButton jbt;
//JList list;
JComboBox comboBox;
String[] packAges={"Factory1","Factory2","Factory3","Factory4"};
JPanel panel;
public Commodity(){
super("Commodity");
Container container=getContentPane();
this.setLayout(null);
label1=new JLabel("商品名:");
textField1=new JTextField(20);
label2=new JLabel("价格:");
textField2=new JTextField(10);
textField2.setText("$");
label3=new JLabel("品牌:");
textField3=new JTextField(15);
label4=new JLabel("厂家:");
comboBox=new JComboBox(packAges);
jbt = new JButton("提交");
label1.setBounds(new Rectangle(90,117,90,20));
textField1.setBounds(new Rectangle(165,120,300,20));
label2.setBounds(new Rectangle(90,139,90,20));
textField2.setBounds(new Rectangle(165,142,150,20));
label3.setBounds(new Rectangle(90,162,90,20));
textField3.setBounds(new Rectangle(165,164,200,20));
label4.setBounds(new Rectangle(90,186,90,20));
comboBox.setBounds(new Rectangle(165,186,130,20));
jbt.setBounds(new Rectangle(300,235,60,25));
container.add(label1);
container.add(textField1);
container.add(label2);
container.add(textField2);
container.add(label3);
container.add(textField3);
container.add(label4);
container.add(comboBox);
container.add(jbt);
setSize(500,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args)
{new Commodity();}
}
界面就这样了,如何提交到数据库要你自己来。
import java.awt.*;
public class Commodity extends JFrame{
JTextField textField1,textField2,textField3;
JLabel label1,label2,label3,label4;
JButton jbt;
//JList list;
JComboBox comboBox;
String[] packAges={"Factory1","Factory2","Factory3","Factory4"};
JPanel panel;
public Commodity(){
super("Commodity");
Container container=getContentPane();
this.setLayout(null);
label1=new JLabel("商品名:");
textField1=new JTextField(20);
label2=new JLabel("价格:");
textField2=new JTextField(10);
textField2.setText("$");
label3=new JLabel("品牌:");
textField3=new JTextField(15);
label4=new JLabel("厂家:");
comboBox=new JComboBox(packAges);
jbt = new JButton("提交");
label1.setBounds(new Rectangle(90,117,90,20));
textField1.setBounds(new Rectangle(165,120,300,20));
label2.setBounds(new Rectangle(90,139,90,20));
textField2.setBounds(new Rectangle(165,142,150,20));
label3.setBounds(new Rectangle(90,162,90,20));
textField3.setBounds(new Rectangle(165,164,200,20));
label4.setBounds(new Rectangle(90,186,90,20));
comboBox.setBounds(new Rectangle(165,186,130,20));
jbt.setBounds(new Rectangle(300,235,60,25));
container.add(label1);
container.add(textField1);
container.add(label2);
container.add(textField2);
container.add(label3);
container.add(textField3);
container.add(label4);
container.add(comboBox);
container.add(jbt);
setSize(500,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args)
{new Commodity();}
}
界面就这样了,如何提交到数据库要你自己来。
展开全部
去Google里找吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
干嘛?做个界面啊?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
....都没说明白这个是干嘛的...
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
干嘛?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询