0
I wonder if there is a way and how to do: type and appear the names in a Combobox, is already listing the database data in the combobox, but I would like to type the initial of the name and go listing. The code:
public void listarAssociadosnoComboboxV() throws Exception {
try {
Cad_Veiculo.cmbfk_associadoV.addItem("SELECIONE");
String sql = "SELECT ID_ASSOCIADO, NOME FROM ASSOCIADO";
preparedStatement = (PreparedStatement) conexao.prepareStatement(sql);
rs = preparedStatement.executeQuery();
while (rs.next()) {
Associado a = new Associado();
a.setIdAssociado(rs.getInt("ID_ASSOCIADO") );
a.setNome( rs.getString("NOME") );
Cad_Veiculo.cmbfk_associadoV.addItem(a) ;
}
} catch (SQLException sqlEx) {
}finally {
Conexao.closeConnection(conexao, preparedStatement);
}
}
I could add information in the question of how the association of the data with the combobox is taking place?
– MauroAlmeida