Can someone help me with my problem please? I have a text field that has the autocomplete action when writing something about it. My problem would be how do I do when I enter another word that does not appear in the autocomplete I get a message saying that the word entered is not correct? I leave the code
public void calle(){
try{
TextAutoCompleter completar = new TextAutoCompleter(txtCalle);
String SQL = "SELECT nombre FROM calle";
Statement st = cn.createStatement();
ResultSet rs = st.executeQuery(SQL);
while(rs.next())
{
completar.addItem(rs.getString("nombre"));
}
}
catch(Exception e) { JOptionPane.showConfirmDialog(null, e);}
}