0

I realize that the title probably seems very confusing, so I am gonna try give an example.

I have a JTable, which i wish to populate an ArrayList of a custom object called rapport.

The rapport object contains: int Number, String caseName, ArrayList, ArrayList, int fee.

So the headers for the JTable looks as following: Number, caseName, appendix , outlay, fee.

So for each rapport in the ArrayList i want a new row with the attributes from the rapport, and the two cells with arraylists is gonna be shown in a JComboBox.

I know to use cellEditor to make specific coloums to contain a JCombobox, but i have no idea's how to load the data from an ArrayList as described.

Any suggestions?

4

1 回答 1

1

扩展AbstractTableModel并包含您的,List<Rapport>如此处所示. Map<String, String>使用生成的模型来构建您的表格。列表的每个元素将是一行,并且该行的每一列将是实例中的对应字段Rapport

于 2013-05-28T20:20:44.050 回答