我正在使用以下代码仅获取 mysql 表的列表并将它们添加到 JComboBox。但我得到的只是 JComboBox 中的“[]”!请帮帮我
ArrayList<String> tables = new ArrayList<String>();
public ArrayList<String> tablesArray() throws SQLException
{
ResultSet result = connecting.getMetaData().getCatalogs();
while(result.next())
{
tables.add(result.getString(0));
}
return tables;
}
public JComboBox comboBox()
{
JComboBox<ArrayList> combo = new JComboBox<ArrayList>();
combo.addItem(tables);
combo.setBounds(130,30,190,30);
return combo;
}