Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int MainMenu(){
- //Displays the main menu and handles passing off to next menu.
- Scanner scanner = new Scanner (System.in);
- int selection=0;
- int x=0;
- while(true){ //changed while(1) to a value that didn't complain in netbeans
- System.out.println("Please Make a selection:");
- System.out.println("[1] Add a new record");
- System.out.println("[2] Open an existing record");
- System.out.println("[3] exit");
- System.out.println("Selection: ");
- selection=scanner.nextInt();
- switch (selection){
- case 1:System.out.println("Adding new record");
- x=1;
- break;
- case 2:System.out.println("Opening existing record");
- x=1;
- break;
- case 3:System.out.println("Exit Successful");
- System.exit(0);
- default:System.out.println("Please enter a valid selection.");
- };
- }
- return selection;
- }
Add Comment
Please, Sign In to add comment