Refresh JList in a JFrame

后端 未结 4 1916
闹比i
闹比i 2020-12-10 10:14

I\'ve got a JList which displays information from a vector. The user can then add and remove information from this vector. Is it possible to refresh the JList inside my JFra

4条回答
  •  暖寄归人
    2020-12-10 10:56

    I think I found the solution for the Jlist's graphic 'refresh'. Try calling this method after each add or remove element of the model that is held by the Jlist.

    Jlist_name.ensureIndexIsVisible(model_name.getSize());

提交回复
热议问题