model view controller - Java DefaultListModel not added to JList - Stack Overflow

Опубликовано: 06 Май 2026
на канале: ResponseXAI
No
0

You are not setting the model to the JList.

When you do,

model = new DefaultListModel();
musicJList = new JList(model);


The JList's model is set to the new DefaultListModel() object.

But after that, you

#getlistmodel()) #doing #setlistmodel(defaultlistmodel #line #this
https://stackoverflow.com/questions/3...

https://stackoverflow.com/questions/3...