News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1194054353:v:use_geshi-1:v:type-java

Started by Guest, Nov 03, 2007, 01:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guest

/**
 * Main class for the menu.
 * @author jaybachatero
 *
 */
public class MenuArray
{
   public static void main(String args[])
   {
      // The choices they can select.
      int choice = 0;
      // We need to start the new menu.
      Menu menu = new Menu();

      // We need to add the menu items we want.
      menu.addMenuItem("Populate array.");
      menu.addMenuItem("Display array.");
      menu.addMenuItem("Find value in array.");
      menu.addMenuItem("Display lowest and highest values.");
      menu.addMenuItem("Display sum and average.");
      menu.addMenuItem("Sort the array");
      // Ok no more menu items.
      menu.addMenuExitItem("Exit Program");
      // Add the heeader and the footer.
      menu.addMenuHeaderFooter("== HEADER ==", "header");
      menu.addMenuHeaderFooter("== FOOTER ==", "footer");

      do
      {
         System.out.println("Test");
      }
      while (menu.currentStep != menu.getExitStep() || choice != menu.getExitStep());

      // Test.
      System.out.println(menu.getMenuItems());
   }
}