JList.getModel() ClassCastException

前端 未结 4 761
悲哀的现实
悲哀的现实 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:29

    Before JList.getModel(), you must initialize your object JList.setModel(new DefaultModelList())

提交回复
热议问题