I recently found there are lots of columns in the db.db file. Such as Flight Number, Origin airport, Destination airport, Carrier so forth.
My question is Which of them does tht customer use to search the Flight? All I should enable the customer to use any of them to search? If that is true, there will be lots of JCombobox and Textboxs, if the customer don't select all of them, that means only use some of the Comboboxes and testboxes, I think I should assembled them together in order to search, I think there will be large ammount of work.
So, I confused whether my analysis is correct?
Pls Guide me.
while the Instructions.html file doesn't exactly spell it out, because there are two areas where it seems that they are mentioning what they can search on. So I took it from both and included; Airline, Arrival Airport, Departure Airport. Not necessarily in that order.
I got to go to a meeting. I'll post again to finish this.
( and author)
You can also simply offer a dialog box that allows the user to type in what they want, per the instructions. Then usedregex to sort the String. It's not that hard, really.
My final statement is that you should use JComboBox for all three. Do not use JTextField, we have found that you will lose points if you do.
( and author)
Originally posted by George Ren:
Thank u , Mark and Max.
So it that mean the customer only use the Airline, Origin airport and Destination airport to search. I only have to design the three JComboboxes for that?
Or I should be like Max said. It will be up to the customer?
Either will work: it's just a matter of writing GUI code or regex code.
But Max ,could u tell me what the "regex code" mean? I havn't heard it before.
Max is talking about the server side, where you need to validate that the string passed to criteriaFind is correct, and extract the column names and values to match from the provided String.
Max is suggesting you use regular expressions, (commonly referred to as regex) which you will find in the java.util.regex package.
If you have never used regular expressions before, you may want to look at them. They are extremly powerful. They can also be difficult to master (which is one reason for looking at them now: you have the time to learn new things - in a real job you may not have the luxury of time).
But you don't have to use regular expressions, there are plenty of other ways that also work. Perhaps not as elegant as regex, but certainly valid nonetheless.