【发布时间】:2011-07-20 00:45:21
【问题描述】:
Connection connection = newConnection.createConnection();
Statement newStat = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet res = newStat.executeQuery("SELECT contactName FROM Contact WHERE accountName='"+m+"'");
Vector<String> temp = new Vector<String>();
//res.first();
while (res.next()){
temp.add(res.getString("contactName"));
}
newStat.close();
connection.close();
customerContactList = new JList(temp);
repaint();
I have a Jlist with account names, when an account is selected, on the side there is a button which has to be pressed for in order to call the code above. 该代码应该获取与该帐户关联的联系人姓名并将其填充到 JList。这不会发生。 Jlist 保持空白,我进行了调试,并且向量 temp 确实获得了 3 个值并将它们存储到新的 jlist 中,问题是 JList 不刷新。
如何让它刷新?
非常感谢,我很感激任何帮助。 库纳尔
【问题讨论】:
标签: java vector refresh jframe jlist