how could i ahhm.."auto-update" my comboBox..?im using glazedlists autoComplete
and im bit lost on how to do it..ive read some like use eventlists
and basiclist
but i couldnt get the idea on how to make it work..
pls help :(
heres my sample code..but i dunno whats next to it..ive tried using eventlists but couldnt make it update on its own..
abc = AutoCompleteSupport.install(comboSearch,GlazedLists.eventListOf(auto));
abc.setStrict(false);
public void count(){
try{
String sql2 = "select count(*) from daily_input";
stmt = conn.prepareStatement(sql2);
rs=stmt.executeQuery();
while(rs.next()){
String x = rs.getString("count(*)");
z = Integer.parseInt(x);
}
auto = new String[z];
idNum = new int[z];
}
catch(SQLException | NumberFormatException e){
}
}
public void cB(){
count();
i=0;
try{
String sql = "Select concat(first_name, ' ',last_name) as full_name from daily_input";
stmt = conn.prepareStatement(sql);
rs=stmt.executeQuery();
while(rs.next()){
String name = rs.getString("full_name");
auto[i] = name;
i++;
}
comboSearch.isEditable();
}
You need to connect your combo-box with event list and then add elements to event list.