我想用 sql 结果填充一个 Jcombobox,但为什么我在这里得到一个 ArrayIndexOufOfBounds?JCombobox 是这样的:countrybox = new JComboBox(countries);
int x = 0;
String query = "SELECT UNIQUE country FROM criminals ORDER BY country ASC";
System.out.println(query);
Statement stmt = connection.createStatement();
ResultSet rset = stmt.executeQuery(query);
while (rset.next()) {
countries[x] = rset.getString(1);
x++;
}