I have been reading tutorials and I am still not sure so I will ask here. Is it possible to have a JTable with 2 columns where column 1 displays contents of an arraylist and column 2 displays numbers up to the size of the arraylist?. I have looked at tutorials but they dont really mention arraylists, so any sample codes or direction would be helpful. Thanks
Share
Yes, of course it’s possible. Implement a table model by extending
AsbtractTableModel, and use the list to implement its methods.Read the JTable tutorial.
The main methods of the table model would look like this: