Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to populate JTable with data from ArrayList

860746Nov 27 2012 — edited Nov 28 2012
Hello guys,
I am a beginner in Swing and this is my scenario, my program is reading text file content, and splits it (regex=" ") into a string array of single words. I then convert the string array of words to a List. Then I count the number of occurrences of each word in the ArrayList. on my GUI, i want to display properties of a file on one table and I have another table on which I want to display all the words along side their frequency.

Can anyone please help me how to:
1. Populate a JTable with data from an array list
2. populate another JTable with file information(properties)

In case you are wondering; the reason why I convert to an ArrayList is because it is mutable and I need to get rid of some words.

Thank you very much.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2012
Added on Nov 27 2012
3 comments
1,996 views