Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question Regarding JCombo Box Rebuilding it Dynamically from db.db

 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now I am dynamically loading the origin comboBox local connection (default) upon starting up.
When the app starts origin combo shows all origin's from db.db minus duplicates and the dest combobox shows only "any" my wild card but when a user clicks on FRA in origin combobox :it will load matches to dest combo box retaing the "any" :: roblem is, if I select FRA again it just keeps adding BOM & DAL again an again etc..
I need to refresh ComboBox>>>>>
Is there any way to refresh combo box as there is with JTable such as repaint() or setModel().
I tryed repaint() without success...
Thanks Lisa
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure why you're doing it the way you are! My instructions say that if a match isn't found, then don't display anything in the table. Sounds like you are only displaying matching dest's in the combo box to a selected orig which isn't exactly what the instructions call for. What I did was to load both orig and dest from the DB at startup and let the user decide.
 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your right paul I reread the instructions I will do the same it is much easier anyways...
Also if no match I will throw up a JPaneOption Information no flight found try another search..
Do you think this will be ok???
Thanks Lisa
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That will work!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic