Results 1 to 6 of 6
  1. #1
    ras_oscar is offline Member
    Join Date
    Jun 2013
    Posts
    55
    Rep Power
    0

    Default Depreciated classes

    I am using Vector to build a collection of text strings to feed to several JComboBox entities throughout my application.
    Vector is depreciated. Does that mean that eventually it will cease to exist, or merely that it will not be further developed? Although I am not planning to commercially distribute my application, I'd like to be able to assess the impact of using a depreciated feature.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,939
    Rep Power
    8

    Default Re: Depreciated classes

    Where do you see that Vector is deprecated?

    From the API for Vector: Unlike the new collection implementations, Vector is synchronized. If a thread-safe implementation is not needed, it is recommended to use ArrayList in place of Vector.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,534
    Rep Power
    5

    Default Re: Depreciated classes

    Vector is not deprecated. It is essentially a synchronized version of ArrayList. It implements
    the same interfaces and has the same parent hierarchy an ArrayList.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Depreciated classes

    It's redundant...:)
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    ras_oscar is offline Member
    Join Date
    Jun 2013
    Posts
    55
    Rep Power
    0

    Default Re: Depreciated classes

    Why is Java Vector class considered obsolete or deprecated? - Stack Overflow

    On re-reading the forum thread. I realized that the OP suggested the class was depreciated, and none of the responders contradicted. Didn't explicitly confirm depreciation, but suggested it. I am using Vector to provide a list of text strings to several JCombobox instances. I did not see a JComboBox constructor that takes an ArrayList.

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,534
    Rep Power
    5

    Default Re: Depreciated classes

    Quote Originally Posted by ras_oscar View Post
    I did not see a JComboBox constructor that takes an ArrayList.
    You could always use the List.toArray() method to populate the JComboBox via a constructor.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. using classes help
    By Omgium in forum New To Java
    Replies: 5
    Last Post: 12-03-2012, 02:08 PM
  2. Association Classes for these classes
    By kevinkhan in forum New To Java
    Replies: 9
    Last Post: 03-21-2012, 05:22 PM
  3. Classes Help!!! two classes with object question.
    By stuckonjava in forum New To Java
    Replies: 16
    Last Post: 02-10-2012, 01:39 AM
  4. Use classes inside of other classes
    By BlankFile in forum New To Java
    Replies: 2
    Last Post: 02-06-2012, 01:51 PM
  5. setShapesVisible: depreciated
    By Friqenstein in forum AWT / Swing
    Replies: 5
    Last Post: 08-08-2010, 11:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •