JCombobox freezes after i choose a date from datechooser?

330 Views Asked by At

I dont know why my combo box freezes after choosing a date.

This is the code for the combobox:

String[] name_bike= {"S","x","x"};
JComboBox comboBox = new JComboBox(name_bike);

comboBox.setBackground(UIManager.getColor("TextField.selectionBackground"));
comboBox.setSelectedIndex(1);
comboBox.setBounds(132, 199, 148, 30);
panel.add(comboBox);

This is for my database:

SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd");
String addDate=dateFormat.format(dateChooser.getDate());
ps.setString(3, addDate);

ps.setString(4,(String) comboBox.getSelectedItem());
ps.executeUpdate();
0

There are 0 best solutions below