Meaningless Drivel is fun!*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Question on GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question on GUI" Watch "Question on GUI" New topic
Author

Question on GUI

Samual Harvey
Ranch Hand

Joined: Aug 06, 2002
Posts: 119
As per the instructions:-

The user should be able to select the origin and destination of flights, and the display should update to show only flights that satisfy those criteria. The user must be able to describe enter the string value "any" for the origin, destination, or both, so as to implement a wildcard-like feature.

Is it advisable to use comboboxes for the origin and destination fields. I am currently using textfields for origin and destination. In this case the user is expected to type in the airport name. Is this OK? I mean I have seen people using comboboxes. But the instructions say that user MUST be able to describe enter....(what does describe enter here means?)...if using comboboxes u can only select but not type..AM I missing any thing here...
Or should I use Editable JComboBox???
Thanks.
[ September 01, 2002: Message edited by: Samual Harvey ]

Samual Harvey<br />SCJP2<br />SCJD2
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
I used combo boxes and received a good score... I missed 1 point on my GUI and they dont tell you why . Anyway, it is definitely easier to use combo boxes because you know what the values are and can easily check against those values. A textfield could be anything... I also added an "any" choice to the top of the combo for the wildcard requirement.
Hope that helps,


scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
I did what Nate did and got perfect on the GUI so you won't lose points for using combo boxes. And it's just good user interface design to use combo boxes if you already know all the possible choices.

Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Thanks you for your information (I've also been wondering how to do it).


Mag
Samual Harvey
Ranch Hand

Joined: Aug 06, 2002
Posts: 119
Yes I have implemented the Jcomboboxes in editable mode.
I have a question. I am trying to bring in the sorted and unique list of origin and destination. Any ideas how should I do this. I have a vector source for my combo boxes.
I tried using HashSet but it does not work correctly. It removes some duplicates but not all. Is there origin/destination data in db.db different?
Thanks.
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
Originally posted by Samual Harvey:
[QB]I have a question. I am trying to bring in the sorted and unique list of origin and destination. Any ideas how should I do this. I have a vector source for my combo boxes.
I tried using HashSet but it does not work correctly. It removes some duplicates but not all.[QB]

I used a TreeSet to get my values for the combo box... it is sorted and a set so I get unique and sorted values. I just walked through the values of the db and tried to add every one, and since it was a set, it rejected duplicates... not the most elegant solution, but Sun did not seem to care
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451

Originally posted by Nate Johnson:
I used a TreeSet...

Now I know you copied off my paper!
Michael Morris
Samual Harvey
Ranch Hand

Joined: Aug 06, 2002
Posts: 119
Yep I tried TreeSet and it works like charm.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on GUI
 
Similar Threads
More criteriaFind and JComboBoxes
How to construct 'String criteria' ? Help!!!
criteriaFin(String str)
I Failed SCJD , Help Me
FBN: Search fields to be provided