Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic Question For JList  RSS feed

 
Hugo Cruz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to remove or clear all the elements already contained in a JList structure.
I have tried with Jlist.removeAll but the items are still there
thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After a removeAll() (just like most calls that change the structure of a Java GUI) you need to call validate() on the container to tell it to redo the layout.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!