public void reset(){
txtid.setText("");
txtname.setText("");
txtclass.setText("");
txtage.setText("");
txtheight.setText("");
txttel.setText("");
txtbirthday.setText("");
txtaddress.setText("");
}
public void setbounds(){
lblid.setBounds(new Rectangle(30,40,50,15));
lblid1.setBounds(new Rectangle(145,40,200,15));
lblname1.setBounds(new Rectangle(145,70,200,15));
lblage1.setBounds(new Rectangle(145,130,200,15));
lblheight1.setBounds(new Rectangle(145,190,200,15));
lbltel1.setBounds(new Rectangle(145,220,200,15));
lblclass.setBounds(new Rectangle(145,100,200,15));
lblname.setBounds(new Rectangle(30,70,50,15));
lblclass.setBounds(new Rectangle(30,100,50,15));
lblage.setBounds(new Rectangle(30,130,50,15));
lblsex.setBounds(new Rectangle(30,160,50,15));
lblheight.setBounds(new Rectangle(30,190,50,15));
lbltel.setBounds(new Rectangle(30,220,50,15));
lblbirthday.setBounds(new Rectangle(30,250,50,15));
lbladdress.setBounds(new Rectangle(30,280,50,15));
txtid.setBounds(new Rectangle(70,38,70,20));
txtname.setBounds(new Rectangle(70,68,70,20));
txtclass.setBounds(new Rectangle(70,98,70,20));
txtage.setBounds(new Rectangle(70,128,70,20));
radboy.setBounds(new Rectangle(70,158,40,20));
radgirl.setBounds(new Rectangle(110,158,40,20));
txtheight.setBounds(new Rectangle(70,188,70,20));
txttel.setBounds(new Rectangle(70,218,70,20));
txtbirthday.setBounds(new Rectangle(70,248,70,20));
txtaddress.setBounds(new Rectangle(70,278,150,50));
btnok.setBounds(new Rectangle(65,340,70,30));
btnreset.setBounds(new Rectangle(155,340,70,30));
txtaddress.setBorder(BorderFactory.createLineBorder(Color.black));
}
public void add(){
pnl.add(lblid);
pnl.add(lblname);
pnl.add(lblclass);
pnl.add(lblage);
pnl.add(lblsex);
pnl.add(lblheight);
pnl.add(lbltel);
pnl.add(lblbirthday);
pnl.add(lbladdress);
pnl.add(txtid);
pnl.add(txtname);
pnl.add(txtclass);
pnl.add(txtage);
pnl.add(txtheight);
pnl.add(txttel);
pnl.add(txtbirthday);
pnl.add(txtaddress);
pnl.add(btnok);
pnl.add(btnreset);
pnl.add(radboy);
pnl.add(radgirl);
pnl.add(lblid1);
pnl.add(lblname1);
pnl.add(lblage1);
pnl.add(lblheight1);
pnl.add(lbltel1);
btngrpsex.add(radboy);
btngrpsex.add(radgirl);
}
public String getid(){
id = txtid.getText().trim();
return id;
}
public String getname(){
name = txtname.getText().trim();
return name;
}
public String getclass(){
classes = txtclass.getText().trim();
return classes;
}
public int getage(){
age = Integer.valueOf(txtage.getText().trim());
return age;
}
public String getsex(){
sex = "男";
if(radgirl.isSelected()){
sex = "女";
}
return sex;
}
public double getheight(){
height = Double.valueOf(txtheight.getText().trim());
return height;
}
public String gettel(){
tel = txttel.getText().trim();
return tel;
}
public String getbirthday(){
birthday = txtbirthday.getText().trim();
return birthday;
}
public String getaddress(){
address = txtaddress.getText().trim();
return address;
}
public JPanel getpnl(){
return pnl;
}
public static void main(String[] args) {
new Insert().action();
}
}
txtid.setText("");
txtname.setText("");
txtclass.setText("");
txtage.setText("");
txtheight.setText("");
txttel.setText("");
txtbirthday.setText("");
txtaddress.setText("");
}
public void setbounds(){
lblid.setBounds(new Rectangle(30,40,50,15));
lblid1.setBounds(new Rectangle(145,40,200,15));
lblname1.setBounds(new Rectangle(145,70,200,15));
lblage1.setBounds(new Rectangle(145,130,200,15));
lblheight1.setBounds(new Rectangle(145,190,200,15));
lbltel1.setBounds(new Rectangle(145,220,200,15));
lblclass.setBounds(new Rectangle(145,100,200,15));
lblname.setBounds(new Rectangle(30,70,50,15));
lblclass.setBounds(new Rectangle(30,100,50,15));
lblage.setBounds(new Rectangle(30,130,50,15));
lblsex.setBounds(new Rectangle(30,160,50,15));
lblheight.setBounds(new Rectangle(30,190,50,15));
lbltel.setBounds(new Rectangle(30,220,50,15));
lblbirthday.setBounds(new Rectangle(30,250,50,15));
lbladdress.setBounds(new Rectangle(30,280,50,15));
txtid.setBounds(new Rectangle(70,38,70,20));
txtname.setBounds(new Rectangle(70,68,70,20));
txtclass.setBounds(new Rectangle(70,98,70,20));
txtage.setBounds(new Rectangle(70,128,70,20));
radboy.setBounds(new Rectangle(70,158,40,20));
radgirl.setBounds(new Rectangle(110,158,40,20));
txtheight.setBounds(new Rectangle(70,188,70,20));
txttel.setBounds(new Rectangle(70,218,70,20));
txtbirthday.setBounds(new Rectangle(70,248,70,20));
txtaddress.setBounds(new Rectangle(70,278,150,50));
btnok.setBounds(new Rectangle(65,340,70,30));
btnreset.setBounds(new Rectangle(155,340,70,30));
txtaddress.setBorder(BorderFactory.createLineBorder(Color.black));
}
public void add(){
pnl.add(lblid);
pnl.add(lblname);
pnl.add(lblclass);
pnl.add(lblage);
pnl.add(lblsex);
pnl.add(lblheight);
pnl.add(lbltel);
pnl.add(lblbirthday);
pnl.add(lbladdress);
pnl.add(txtid);
pnl.add(txtname);
pnl.add(txtclass);
pnl.add(txtage);
pnl.add(txtheight);
pnl.add(txttel);
pnl.add(txtbirthday);
pnl.add(txtaddress);
pnl.add(btnok);
pnl.add(btnreset);
pnl.add(radboy);
pnl.add(radgirl);
pnl.add(lblid1);
pnl.add(lblname1);
pnl.add(lblage1);
pnl.add(lblheight1);
pnl.add(lbltel1);
btngrpsex.add(radboy);
btngrpsex.add(radgirl);
}
public String getid(){
id = txtid.getText().trim();
return id;
}
public String getname(){
name = txtname.getText().trim();
return name;
}
public String getclass(){
classes = txtclass.getText().trim();
return classes;
}
public int getage(){
age = Integer.valueOf(txtage.getText().trim());
return age;
}
public String getsex(){
sex = "男";
if(radgirl.isSelected()){
sex = "女";
}
return sex;
}
public double getheight(){
height = Double.valueOf(txtheight.getText().trim());
return height;
}
public String gettel(){
tel = txttel.getText().trim();
return tel;
}
public String getbirthday(){
birthday = txtbirthday.getText().trim();
return birthday;
}
public String getaddress(){
address = txtaddress.getText().trim();
return address;
}
public JPanel getpnl(){
return pnl;
}
public static void main(String[] args) {
new Insert().action();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货