我的代码如下public static void main(String args[]){
JFrame f=new JFrame("添加");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(300, 400);
JPanel p=new JPanel();
t1=new JTextField(10);
jc1=new JComboBox();
jc1.setEditable(true);
 ResultSet rs;
try {
rs = Sqlconn.getStatement().executeQuery("SELECT DIstinct Production_name FROM Production_name");

while(rs.next()){
  jc1.addItem(rs.getString(1));
}

} catch (SQLException e) {

e.printStackTrace();
}
jc1.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent e) { }
        public void focusLost(FocusEvent e) {
 ResultSet rs2;
 String a=null;
try {
rs2 = Sqlconn.getStatement().executeQuery("Select max(ID)+1 from Production_name");
while(rs2.next()){
  a=rs2.getString(1);
}
} catch (SQLException e2) {
e2.printStackTrace();
}
ResultSet rs1;
try {
rs1 = Sqlconn.getStatement().executeQuery("SELECT DIstinct Production_name FROM Production_name");
while(rs1.next()){
   if(!rs1.next()){
Sqlconn.getStatement().executeUpdate("Insert into Production_name(ID,Production_name) Values('"+a+"','"+jc1.getSelectedItem().toString().trim()+"')");
            jc1.addItem(jc1.getSelectedItem().toString().trim());
 }
if(jc1.getSelectedItem().equals(rs1.getString(1))==true){
break;
}else{continue;}
}

 rs1.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
      
    p.add(jc1);
    p.add(t1);
f.add(p);
f.pack();
f.setVisible(true);
}
上边的代码,当焦点离开JComboBox后,并没有任何反映,各位高手请问这是怎么回事啊!我什么地方错了啊!!谢谢!!