Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Problem with reset on JComboBox

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Problem with reset on JComboBox

    Hey all,

    Any help would be appreciated. I have a delimited file being read in with the scanner method and then fed to a vector. Three JComboBoxes are generated with these vectors. Each combo uses a filter based upon what was selected from the other. Only problem is that when I go to remove filter and put JComboBoxes back to original state it doesn't work. I have tried setFocusable(false) and it does not do what I want. I can not use setSelectedIndex(0) because I am using scanner method to read my file which utilizes String not Object. The filter works properly but I like things fully dynamic and functional. Any suggestions are great appreciated and needed.


    Thanks WorkingMan


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Problem with reset on JComboBox.

    Hey WorkingMan,

    Can you post your code here for us to take a look at?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Banned
    Join Date
    May 2008
    Posts
    25
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Problem with reset on JComboBox.

    The easiest way is to "empty"your vector and loop the empty vector although there are other ways to accomplish this.

  4. #4
    Junior Member
    Join Date
    Oct 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem with reset on JComboBox.

    And, just as a side note, a String is an Object...Every class in Java is derived from Object. From the API documentation:

    java.lang.Object
    extended by java.lang.String


    Cheers,

    Sean C.
    PekinSOFT Systems

  5. #5
    Junior Member
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem with reset on JComboBox

    im too..i have a problem to reset jcombobox..i try to use setSelectedIndex(0)..but its doesn't work..

Similar Threads

  1. Replies: 24
    Last Post: April 14th, 2009, 03:43 PM
  2. Replies: 4
    Last Post: May 27th, 2008, 01:20 PM