java壓方象垂峨秘bean
扮寂:2011-04-03
幹秀方象垂燕:
create table test.Student(
ID VARCHAR(10),
Name VARCHAR(20),
Bedroom VARCHAR(20),
Zhuanye VARCHAR(40),
Sex VARCHAR(1)
)
/* bean 旗鷹 */
package student;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class stuBean extends JPanel {
private static final long serialVersionUID = 9166303709249041951L;
private JComboBox combBed;
private JComboBox combDanyuan;
private JComboBox combFool;
private JTextField textName;
private JTextField textID;
private JComboBox combSex;
private JComboBox combSpecial;
private String bedroom;
private String special;
private String sex;
private String userName="root";
private String password="";
private String url;
private String strDriver;
private Connection conn;
private java.sql.PreparedStatement stat;
/**
* Create the panel
*/
public stuBean() {
super();
setLayout(null);
final JLa
bel label = new JLabel();
label.setText("僥催");
label.setBounds(37, 29, 66, 18);
add(label);
textID = new JTextField();
textID.setBounds(109, 27, 119, 22);
add(textID);
final JLabel label_1 = new JLabel();
label_1.setText("侖兆");
label_1.setBounds(37, 79, 66, 18);
add(label_1);
textName = new JTextField();
textName.setBounds(109, 77, 119, 22);
add(textName);
final JLabel label_2 = new JLabel();
label_2.setText("凡普");
label_2.setBounds(37, 129, 66, 18);
add(label_2);
combFool = new JComboBox();
combFool.setBounds(109, 125, 43, 27);
combFool.addItem(new String("1"));
combFool.addItem(new String("2"));
combFool.addItem(new String("3"));
combFool.addItem(new String("4"));
combFool.addItem(new String("5"));
combFool.addItem(new String("6"));
combFool.addItem(new String("7"));
combFool.addItem(new String("8"));
combFool.addItem(new style="COLOR: #ff0000">String("9"));
combFool.addItem(new String("10"));
add(combFool);
final JLabel label_3 = new JLabel();
label_3.setText("促");
label_3.setBounds(158, 129, 26, 18);
add(label_3);
combDanyuan = new JComboBox();
combDanyuan.setBounds(200, 125, 43, 27);
combDanyuan.addItem(new String("1"));
combDanyuan.addItem(new Strin
|