JList.getModel() ClassCastException

前端 未结 4 733
悲哀的现实
悲哀的现实 2020-12-16 21:56

When I call JList.getModel() and cast it to DefaultListModel it gives me this exception.

Exception in t         


        
4条回答
  •  失恋的感觉
    2020-12-16 22:21

    If you are using NetBeans

    1. Select your jList
    2. In properties, click the model button
    3. select the "Custom code" option
    4. Write new DefaultListModel ()

    jList custom code

提交回复
热议问题