aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes column fields values questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "column fields values questions" Watch "column fields values questions" New topic
Author

column fields values questions

Kruger Scheitz
Ranch Hand

Joined: Jul 31, 2002
Posts: 72
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
Stephane Weber
Ranch Hand

Joined: Mar 07, 2002
Posts: 110
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

Joined: Jul 31, 2002
Posts: 72
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

Joined: Mar 07, 2002
Posts: 110
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

Joined: Jul 31, 2002
Posts: 72
oh that's cool
Thomas Fly
Ranch Hand

Joined: Sep 09, 2002
Posts: 164
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 ).


Fly by Night Consultants<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr><i>I climbed on the back of a giant albatross<br />which flew through a crack in the cloud<br />to a place where happiness reigned...<br />all year 'round<br />the music played ever so loudly!</i><p><a href="http://thomasfly.com/songs/Traffic/Hole_in_my_Shoe_qt.htm" target="_blank" rel="nofollow">Hole in My Shoe</a><hr></blockquote>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: column fields values questions