Results 1 to 6 of 6
Thread: Use JTable without using Vector
- 10-05-2010, 05:10 AM #1
Member
- Join Date
- Apr 2010
- Posts
- 32
- Rep Power
- 0
- 10-05-2010, 06:06 AM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Use your own table model.
Implement your table model in a subclass of the AbstractTableModel class and use e.g. a list or an array.
see How to Use Tables (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
-
Vector is not obsolete and certainly hasn't been deprecated. Where have you read this?
It may be a little slower than an ArrayList since it is synchronized while ArrayList isn't, but again, it hasn't been deprecated and is fully supported by Java now and in the forseeable future.
Incidentally, if you want to use your own data structure as the nucleus of your JTable model, then subclass AbstractTableModel, but be prepared to do a bit more work to get it working.
- 10-05-2010, 08:28 AM #4
Member
- Join Date
- Apr 2010
- Posts
- 32
- Rep Power
- 0
Thanks eRaaaa and Fubarable, I use Netbeans 6.9 and it marks Vector is obsolete. Then I search on google about "Vector obsolete", I found many forum said that: "Java Vector is obsolete because it's synchronized".
-
What specifically does NetBeans state in its warning? What's the exact wording?
Information found in fora is not guaranteed to be correct. Have you found anything regarding this on the official Oracle Java sites?Then I search on google about "Vector obsolete", I found many forum said that: "Java Vector is obsolete because it's synchronized".
- 10-06-2010, 07:18 AM #6
Member
- Join Date
- Apr 2010
- Posts
- 32
- Rep Power
- 0
Similar Threads
-
Vector<vector> loop thru
By ocean in forum New To JavaReplies: 11Last Post: 11-21-2009, 02:17 PM -
JTable, Vector, File, Problem.
By ocean in forum New To JavaReplies: 4Last Post: 11-06-2009, 07:51 AM -
Vector
By MuslimCoder in forum Advanced JavaReplies: 4Last Post: 08-06-2009, 03:44 PM -
Vector<Point2D> list = new Vector<Point2D>();Is it possible for 15,000 Point2D obj???
By Mazharul in forum Java 2DReplies: 1Last Post: 04-06-2009, 06:45 AM -
Jtable duplicates through Hashtable (JTable condition problem) my assignment plz help
By salmanpirzada1 in forum Advanced JavaReplies: 2Last Post: 05-15-2008, 10:15 AM


LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks