@@ -0,0 +1,1872 @@
+/*%0A   Programmer: Kristoffer Larson%0A   Date: February 3,2014%0A   %0A   Description: Modifying the BoxLayoutDemo from the Oracle%0A      website, this allows the user to choose which button%0A      to display when the frame shows. This makes use of%0A      showInputDialog() and parses the value to an integer.%0A   %0A*/%0A     %0Aimport java.awt.*;%0Aimport javax.swing.*;%0A%0Apublic class GUI_Input %7B%0A   public static void addComponentsToPane(Container pane) %7B%0A      %0A      pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));%0A      %0A      String inputValue = JOptionPane.showInputDialog(%22Please input a value (1-8)%22);%0A      int choice = Integer.parseInt(inputValue);%0A      %0A      switch(choice) %7B%0A         case 1: addAButton(%22Button 1%22, pane); break;%0A         case 2: addAButton(%22Button 2%22, pane); break;%0A         case 3: addAButton(%22Button 3%22, pane); break;%0A         case 4: addAButton(%22Long-Named Button 4%22, pane); break;%0A         case 5: addAButton(%225%22, pane); break;%0A      %7D%0A   %7D%0A%0A   private static void addAButton(String text, Container container) %7B%0A      JButton button = new JButton(text);%0A      button.setAlignmentX(Component.CENTER_ALIGNMENT);%0A      container.add(button);%0A   %7D%0A%0A   private static void createAndShowGUI() %7B%0A      //Create and set up the window.%0A      JFrame frame = new JFrame(%22Test%22);%0A      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A   %0A      //Set up the content pane.%0A      addComponentsToPane(frame.getContentPane());%0A   %0A      //Display the window.%0A      frame.pack();%0A      frame.setVisible(true);%0A   %7D%0A%0A   public static void main(String%5B%5D args) %7B%0A      //Schedule a job for the event-dispatching thread:%0A      //creating and showing this application's GUI.%0A      javax.swing.SwingUtilities.invokeLater(%0A            new Runnable() %7B%0A               public void run() %7B%0A                  createAndShowGUI();%0A               %7D%0A            %7D);%0A   %7D%0A%7D%0A

Create GUI_Input.java