File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes return to main menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "return to main menu " Watch "return to main menu " New topic
Author

return to main menu

Yani Abela
Greenhorn

Joined: Jan 30, 2012
Posts: 17
hi there
I am currently doing a DVD Rental System that when the user runs the program, he gets to choose from the menus. My problem is that when the user enters a menu and customizes for example a client, I don't know how to go back for the main menu. This is what I have done so far;

This is the main menu


Then the user chooses for example the number 1 (Clients) and the following menu is then shown:


now my problem is that I don't know what do I have to write in case 6 so that the main menu will be shown again. Can somebody please help?? Thanks
Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 67
My little advice.


Try encapsulation.

Put every menu inside a function like this
Ted Smyth
Ranch Hand

Joined: May 28, 2008
Posts: 73
Yani Abela wrote:I am currently doing a DVD Rental System that when the user runs the program, he gets to choose from the menus. My problem is that when the user enters a menu and customizes for example a client, I don't know how to go back for the main menu.


Hi Yani! When case #6 is selected, you need to break out of that loop (typically by setting your while condition to false, see code snippet below). Without seeing your program I can't guarantee this will work, but likely this is the solution you are looking for. The "Clients" screen is a loop that was accessed from the Main Menu loop, so to return to the first loop, simply break out of the second loop.



Edward Smith
Yani Abela
Greenhorn

Joined: Jan 30, 2012
Posts: 17
hey thanks for your replies !! they helped a lot and I solved it thanks again!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: return to main menu
 
Similar Threads
Not able to apply decode function to my query
Ordering elements in a PriorityQueue
String literals
Sequencing Records
How to extract columns of coordinate values from text file (in java) ?