If I understand your question right, you are asking if it is OK to have a Menu item and a Button do the same thing. If that is your question, I did exactly that as well as create accelerators. I think that it's always good to give the user plenty of input options since some are more comfortable with a keyboard than a mouse.
Hope this helps,
yes, you understand my question. If you could please give me some hint about deploying accelators (I suppose they are short cuts for keyboard ) in menus. It would be nice of you. On other hand you told me to use buttons. can I ask you how did you used in your application, I mean to say how did it apperared in your GUI. One thing more morris I had used null layout in my GUI, will this work. Further I had only used JTable , two buttons (Flight reservation and exit) and menus. Tell me if I am wrong in any area.
If you could please give me some hint about deploying accelators (I suppose they are short cuts for keyboard ) in menus.
Look up javadocs for setAccelerator() and setMnemonic().
I had used null layout in my GUI, will this work.
That will work, but it will cost you a lot of GUI points. The common practice is to use layout managers so that your app frame is resizable and the controls are presented as expected on all platforms.
[ August 03, 2002: Message edited by: Eugene Kononov ]
Hope this helps,
Yes, I will do as you suggest. But which layout do you suggest that I should use ?. Secondly, morris you told me that your Booking was encapsulated with row selection. But I would be using another window for booking tickets. That is client would be having all the list of destinations and as user select's any destination it will get its respected Flight no.s designated for that route and thus with the no. of passengers entered by user will get detected from actual DataInfo object.
Thirdly, I am using WindowHandler class which will keep track of the instances of windows active. That it would not allow the user to keep on activating windows for fun. As this would keep on eating machine resources. I had designed excepton for this stating "You had already activated window, you may open it again but after closing this window". Means after closing the respective window then only user can activate it. What is you sugession about this. Shall I keep it or abort it ?.
The layout manager (or managers) you use depends on the position of your components. You will usually need a combination of layout managers or use the much feared GridBagLayout which gives total control over your Frame but is very complicated. I used combinations of Border, Grid and Flow. Remeber that you can nest JPanels inside of other JPanels, each having their particular layout.
I'm not suggesting that you accomplish booking the same way I did or that my solution is superior to all others because it is not. The main consideration is can all users easily understand how to book a flight. How is your input accomplished? Do you pop up a dialog when the user selects a row? If you'll give me a little more info on your booking procedure maybe I can give you an opinion.
Hope this helps,
I would do exactly what you had earlier suggested, because I feel your design is much more good. This is for the reason that it reduces the coding overload and secondly, the user can simply understand the procedure for booking seats. In my design after reading your post I changed my booking UI design. The user simply first had to select a row then it will click on a button called "FLIGHT RESERVATIONS" then a Window will appear with a textfield asking for number for passengers to book. once the user presses "BOOK SEATS" button in that window it will further proceed. Is this OK. Does it require any enhancement then let me know.
Secondly, there was another thing I wanted to ask I had posted this thing in my earlier posts but no one had replied. I am implementing a class called WindowHandler which will keep track of all the active instances. If any window is active and user again tries to open the same window then exception would be thrown stating "that your so and so window is active, you may again open it but after closing it". This I had developed for the reason that it will give no chance to the user to play with program. As this would result in unneccessary wastage of system resources. Because when we instantiate a class it consumes lot of system memory. What you have to say over this ?.
If any window is active and user again tries to open the same window then exception would be thrown stating "that your so and so window is active, you may again open it but after closing it".
This is very awkward. Why not instead make the window modal or disable the "open window" functionality if the window is already open?