Editable JList

It seems that there is no such thing as an editable JList considering that a JList component is for display purposes only. A workaround that programmers often do is to use a 1 column JTable instead.

If you really want to use an editable JList, a coder named Santosh Kumar made his very own class to do just that. Google his name plus the keyword “editable JList“.

For simplicity’s sake though, use a JTable since the component is already there. And there is nothing hard using a JTable if you already used one before. Just hide the headers and you will be all set.

Still, I cannot help but think why Sun did not provide an option to make a JList component editable.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *