开发者

Display data in a ArrayList in a Jtable

开发者 https://www.devze.com 2023-03-14 17:02 出处:网络
I have an ArrayList o开发者_Python百科f objects and I want to display that information in a jtable. When new information are generated the table needs to be updated. How can I do this? at least some h

I have an ArrayList o开发者_Python百科f objects and I want to display that information in a jtable. When new information are generated the table needs to be updated. How can I do this? at least some help.


Extend DefaultTableModel or AbstractTableModel and build a custom model or just use the plain DefaultTableModel. Have updates flow to this model and this will feed the JTable.

I would highly recommend reading over the tutorial as these are basic questions: http://download.oracle.com/javase/tutorial/uiswing/components/table.html


I have an ArrayList of objects

Sounds like the Bean Table Model can help you out.

Or, if you mean you have an ArrayList of ArrayLists, then you use the List Table Model.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号