• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

column fields values questions

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding the JCombobox fields values, i would like to know how does everyone normally implement them? do they hardcode them or get the field values from the db ?? pls help
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personnally, I read those values from the database ...
This is more generic.
But of course, you could also hardcode them.

Stephane
 
Kruger Scheitz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if u get the values from the db, i guess u need to write some algorithm method to elimate the duplication of values when the combobox retrieves the them from db...am i right?
 
Stephane Weber
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes indeed.
But as I am using a HashSet as temporary structure while reading the database, this takes care of eliminating duplicates for me.
And I just ahve to fill the combo with the contents of the HashSet.
Stephane
 
Kruger Scheitz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh that's cool
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ArrayList serves about the same purpose as HashSet, and sorting an ArrayList is fairly painless using java.util.Collections (hint, if you have a box for selecting flight days, you shouldn't use an alphabetic sort )
I also get my column names from the database. On the other hand, Michael Morris said he hard-coded his (in an FBNconstants class), and he made a 154 (lost a point on documentation ).
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic