JComboBox Loaded with 20,000 data.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dycharles
    New Member
    • Sep 2007
    • 17

    #1

    JComboBox Loaded with 20,000 data.

    I have a JComboBox loaded with 20,000 data, my problem is when i scroll down or scroll up, it is slower than the JComboBox with the smaller data. What can i do to make my JComboBox run faster or like the JComboBox with smaller data?

    Anyone can help me please. Thanks.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by dycharles
    I have a JComboBox loaded with 20,000 data, my problem is when i scroll down or scroll up, it is slower than the JComboBox with the smaller data. What can i do to make my JComboBox run faster or like the JComboBox with smaller data?

    Anyone can help me please. Thanks.
    Do you think users would want to scroll through 20,000 items to pick their choice?
    I think you should redesign your GUI somewhat.

    kind regards,

    Jos

    Comment

    • dycharles
      New Member
      • Sep 2007
      • 17

      #3
      Nope. but i have a special search method in my JComboBox to find those item.

      If we say like this the user will type "category" and the JComboBox will point or select the category item in that list. And then if the user will choose other data that is below to that data in that list which is "category". When the cursor move down, it is just much slower.

      Any other suggestion?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by dycharles
        Nope. but i have a special search method in my JComboBox to find those item.

        If we say like this the user will type "category" and the JComboBox will point or select the category item in that list. And then if the user will choose other data that is below to that data in that list which is "category". When the cursor move down, it is just much slower.

        Any other suggestion?
        20 000 is just a lot. Why don't you split the data up into categories and use two combos, one for categories and one for the data and populate the data one based on the value selected on the category one.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by dycharles
          Nope. but i have a special search method in my JComboBox to find those item.

          If we say like this the user will type "category" and the JComboBox will point or select the category item in that list. And then if the user will choose other data that is below to that data in that list which is "category". When the cursor move down, it is just much slower.

          Any other suggestion?
          Are you sure it isn't your 'special search method' that's slowing things down?

          kind regards,

          Jos

          Comment

          • dycharles
            New Member
            • Sep 2007
            • 17

            #6
            Thanks for that suggestion. I'm thinking that way too.

            But Is there anyway in java that we could speed that up when we used JComboBox?(just for curiousity) Or will just add more speed of the computer? Hehe... Thanks.

            Comment

            • dycharles
              New Member
              • Sep 2007
              • 17

              #7
              Originally posted by JosAH
              Are you sure it isn't your 'special search method' that's slowing things down?

              kind regards,

              Jos
              I think with that too, but i'm just curious if anyone encountered this problem. Thanks

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by dycharles
                I think with that too, but i'm just curious if anyone encountered this problem. Thanks
                What happens if you temporarily remove that 'special search function'? Does it
                scroll up and down as fast as ever?

                kind regards,

                Jos

                Comment

                • dycharles
                  New Member
                  • Sep 2007
                  • 17

                  #9
                  Originally posted by JosAH
                  What happens if you temporarily remove that 'special search function'? Does it
                  scroll up and down as fast as ever?

                  kind regards,

                  Jos
                  I just tried your suggestion now, it works fined. But not really slow than i have my 'special search funtion' but you can still spot the difference when you move your keys around the list, the difference is maybe a fraction of a second with the smaller data.

                  Do you think we can make a special function with that search?

                  Thanks.

                  Comment

                  Working...