Why I cannot add ArrayList directly to Jlist?

后端 未结 4 1496
野的像风
野的像风 2021-01-24 09:07

i am trying to add ArrayList to Jlist, but the only way that I given to understand is that to write the code like this :

ArrayList labels = new Arr         


        
4条回答
  •  别那么骄傲
    2021-01-24 09:44

    JList has no constructor that accepts a List. The first example works as it uses the constructor JList(Object[]).

    Familiarize yourself with the javadoc

提交回复
热议问题