http://i.stack.imgur.com/8rQW1.png
JScrollPane scrollPane_4 = new JScrollPane();
scrollPane_4.setViewportView(list_4);
final JList list_4 = new JList(modelItems);
list_4.setBounds(428, 39, 294, 187);
JButton btnNewButton_4 = new JButton("Refresh");
btnNewButton_4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
modelItems.clear();
arrayOfItems.clear();
for(RSItem d : Inventory.getAll())
{
arrayOfItems.add(d);
modelItems.addElement("Item: "+d.getID()+" at spot: "+(d.getIndex()+1));
}
}
});
我不确定是什么导致了这种情况发生。我有许多其他 JLists 几乎完全相同的代码,这不会发生。