Jlist
JList is a Java Swing component that displays a list of objects and allows the user to select one or more items
Jtable
JTable is a Java Swing component used to display and edit regular two-dimensional tables of cells.
Rendering strategy listcellrenderer
Example |
---|
"I think jtable would be better jcomponents as jlist because there you can implements tablecelleditor maybe example with similair output here" from question JButton in JList Handling |
"I don t really think that jtable will help you here anyhow better than jlist - it has the same rendering strategy" from question Java styling JList for a chat |
"Again use a listcellrenderer to customise the look of the jlist to your needs;you should also consider using a jtable which is better at displaying structured data see how to use tables for more details" from question How to make a relation beetween a JComboBox and a JList like in a Database(1:toMany)? |
"Don t use a jlist;a jtable is better for displaying data in columns" from question [ NOT SOLVE] issue with list model list.removeAllElements java swing |
"Se a jtable with a jradiobutton in one column;not much better then the jlist but the jlist provides a slightly better visual cue" from question JOptionPane inputDialog method doesn`t show horizontal scroll bar instead stretch the width of dialog with the largest data in the list |
Others
Example |
---|
You could use the key bindings api to add support but it s not intuitive and now you implementing functionality you d get for free using a jtable based solution anyway generally speaking it s not intuitive as jlist is not meant to be editable so most users won t have that expectation mindset and it could cause frustration for the user as their expected results don t meet what your program is now doing from question Checkboxes in jcombobox : never checked |
Jlist is not yet editable and might never be;jtable would handle the layout problems for you and you can easily access the values via the table from question Java Swing Scrollpane in NetBeans |
A jlist would probably be better than a jtable from question Java Thumbnail View |