// Filename MenuDispatch.java. // Providing a demonstration of the initial Interactive Menu, // showing its use with manifest values. // // Written for JFL book Chapter 6 see text. // Fintan Culwin, v0.1, January 1997 // modified to take character as menu input import Menus.BasicMenu; public class MenuChar { static final char FIRSTOPTION = 'A'; static final char SECONDOPTION = 'B'; static final char THIRDOPTION = 'C'; public static void main( String argv[]) { String demoOptions[] = { "This is the first option", "This is the second option", "This is the third option"}; char demoChoice; BasicMenu demoMenu = new BasicMenu( "", demoOptions, ""); System.out.println( "\n\t\t Basic Menu demonstration "); System.out.println( "\n\n Testing the offerMenuAsInt() action ... \n\n"); demoChoice = demoMenu.offerMenuAsChar(); switch ( demoChoice ) { case FIRSTOPTION: System.out.println( "\n\n You chose the first option."); break; case SECONDOPTION: System.out.println( "\n\n You chose the second option."); break; case THIRDOPTION: System.out.println( "\n\n You chose the third option."); } // end switch. } // End main } // End MenuChar.