Originally posted by Kalichar Rangantittu:
Congratulations Sir. Great job! I was wondering if you could provide some tips on how you designed the gui as you scored perfect on that?
1. I have a base panel that extends JPanel. It includes implementation to track listeners.
2. I have a panel that extends the base panel and holds the JTable. It generates an actions for listeners whenever the user double clicks on a row. It has a setFilter method, which takes a criteriaFind-compatible
string. Whenever this method is called, it requeries the model for data. My table model is an anonymous inner class extending DefaultTableModel. I override isCellEditable to return true. I override the CellRenderer for the seat column to be left justified. Of course, the whole thing goes in a JScrollPane, which I set the initial size large enough to display all column headings.
3. I have another panel that extends the base panel and displays a combo box for origin, destination, and a submit button. Clicking the submit button generates an action for listeners that the "filter" has changed. It also has a method getFilter() which builds the criteriaFind-compatible string.
4. I have a controller that listens for actions from both these panels. It also sets up a JFrame in which these two panels go. I also have a menu for bringing up the Reservation Dialog and an Exit option. Shortcut keys such as Alt-A to bring up the menu were used.
That's about it. Nothing fancy, but I had all the appropriate stuff for doing everything with the mouse or keyboard, it all resizes properly on the screen, and I believe I made a good use of MVC.
Oh yes, local vs. remote, the database location, codebase, etc. were all taken care of on the command line.
[ January 29, 2002: Message edited by: Len White ]