This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Recently I have learned that an ArrayList is acually better than a Vector because it is faster. Does anyone know why Sun would not have included a method in there JTable to accept ArrayLists as parameters?
hi, Vector is synchronized while ArrayList is initially not. If they would accept an ArrayList as argument they would have to make sure that it's synchronized. Not, that this is a big problem. I think they just didn't change the implementation of DefaultTableModel which uses Vector though they are propagating the use of ArrayList to everyone else. Anyway, as Vector is a subtype of collection it's not that difficult to use ArrayLists and initialize a JTable using a vector, nonetheless: ArrayList data = new ArrayList(); JTable table = new JTable(new Vector(data)); Another possibility is to create your own TableModel which uses a synchronized ArrayList or HashMap or whatever is the most efficient container in this case. cheers
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com