Borneq
unread,Jan 24, 2012, 1:48:45 PM1/24/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Mam values_list_1 = new String[] {"l", "l", "l", "l", "l", "l",..."l"};
typu String[]
list mogę inicjować list_1 = new JList(values_list_1);
lub
list_1 = new JList();
list_1.setModel(new AbstractListModel() {
public int getSize()
{
return values_list_1.length;
}
public Object getElementAt(int index)
{
return values_list_1[index];
}
});
Jak teraz wypełnić innymi wartościami przy przyciśnięciu przycisku?
btnNewButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
values_list_1 = new String[] {"23","34"};
}
});
Te dwie wartości pojawiają się dopiero gdy ruszę suwakiem ale wielkość
listy pozostaje nadal taka sama, getSize() wołane jest raz, jak zmusić
aby wywołane zostało jeszcze raz?