title: How do you make a GUI from an exsisting textual menu using JOptionPane?
body: <p>I have created a class that has methods for getting, setting and displaying computer details. I have then created a test class that displays this methods and uses a textual menu for the user to interact with (shown below). I now need to upgrade this to a GUI interface using JOptionPane but I have no clue where to start as this is all new to me. If anyone has any advice or suggestions it would be greatly appreciated. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class SystemTest_Y3881268 {
  
      public static void main(String[] args) {
          //Create System_Y3881268 object and test methods
          System_Y3881268 s=new System_Y3881268("Lenovo", 
              "Ideacentre A340-24IWL", 2);
          s.setHardDisk(2);
          s.setMemory(128);
          s.setPurchaseCost(599);
  
          //Create textual menu
          int memorySize;
          double hardDiskSize;
  
          @SuppressWarnings("resource")
          Scanner keyboard = new Scanner(System.in);
          char choice;
          do 
          {
              System.out.println();
              System.out.println("***** Computer system menu *****");
              System.out.println();
              System.out.println("Choice 1: Print System Details");
              System.out.println("Choice 2: Diagnose System");
              System.out.println("Choice 3: Set Details");
              System.out.println("Choice 4: Print System Properties");
              System.out.println("Choice 5: Quit the Program");
              System.out.println();
              System.out.println("Enter a number from 1 - 5");
              System.out.println();
              choice = keyboard.next().charAt(0);
  
              switch(choice) 
              {
  
              case '1': 
              {
                  s.displayDetails();
              }
              break;
  
              case '2': 
              {
                  s.diagnoseSystem();
              } 
              break;
  
              case '3': 
              {
                  System.out.println("Enter hard disk size in GB: ");
                  hardDiskSize = keyboard.nextDouble();
                  if(hardDiskSize&lt;2) 
                  {
                      System.out.println("Hard disk size = Low");
                  }
  
                  else 
                  {
                      System.out.println("Hard disk size = Ok");
                  }
  
                  System.out.println();
                  System.out.println("Enter memory size in MB: ");
                  memorySize = keyboard.nextInt();
                  if(memorySize&lt;128) 
                  {
                      System.out.println("Memory Ok = False");
                  }
  
                  else 
                  {
                      System.out.println("Memory Ok = True");
                  }
  
              }
              break;
  
              case '4' : 
              {
                  System_Y3881268.displaySystemProperties();
              }
              break;
  
              case '5' : break;
              default :  System.out.println("Enter only numbers from 1 - 5");
                     System.out.println();
              }
          } while(choice != '5');
      }
  }
  </code></pre>