如何过滤 jcombobox 中的文本。 jComboBox 由 sql select 填充。 需要用可编辑的jcombobox进行过滤
String query = "SELECT Query ";
try {
pst = conn.prepareStatement(query);
rs = pst.executeQuery();
while (rs.next()) {
String committee = rs.getString("column_name");
jComboBox1.addItem(column_name);
AutoCompleteDecorator.decorate(jComboBox1);
}
} catch (SQLException e) {
e.printStackTrace();
}