DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    635

    1.5 headaches with generics

    Now with Tiger, this is how I have to create my Vector for my JTable.

    Vector<String> columns = new Vector<String>();

    But the data Vector is a Vector of Vectors, and I don't know how the syntax should look for that. Plus, this new method of using generic types allows me to only have 1 type of object in the Vector. Previously, a row of data in my table would look like this:
    Code:
    MP3, String, String, String
    When the user double clicked a row, I would get the MP3 object and use its methods to get the path of where the real file is stored. I did not want to display the whole pathname in my table. Anyone help me out here?

  2. #2
    Join Date
    Oct 2004
    Posts
    311
    isn't it possible to declare you Vector as followed:

    Vector<Object> myVector = new Vector();

    Using the most basic Object class should allow you to put most anything in there.

  3. #3
    Join Date
    Mar 2004
    Posts
    635
    hey, good point.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links