title: Graphical User Interface into Java code
body: <p>So I've managed to make the program work but my professor asks for it to be done in GUI format. The issue is, I've tried to make whatever I have work with a GUI supplement but I'm fairly new with how this works. I've looked through many sites and questions on here but I'm not too familiar with how this works. I'm worried I'll mess with my code so I just want to have an idea of how I can implement the GUI into this.</p>
  
  <p>I've tried to make it so that some of the text do appear in a Pane but I don't know how to incorporate with GUI when inputting -1 as an indication that the inputs are in as well as using this concept on string course = keyboard.next();</p>
  
  <hr>
  
  <p>In short, I'm just at a loss with this.</p>
  
  <p>Some important things to look at [The Code without the mess I made with GUI]</p>
  
  <pre><code>import javax.swing.*;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.HashMap;
  import java.util.Scanner;
  import java.io.FileNotFoundException;
  import java.io.File;
  
  public static void main (String [] args)
  {
  
      HashMap &lt;Integer, ArrayList &lt;String&gt;&gt; students = new HashMap &lt;&gt;();
  
      System.out.println ("This program correlates ID with student courses\n");
      int currentID;
      boolean editing;
  
      while (true) {
          System.out.println ("Please enter Student ID: \n(Then enter a -1 when inputs are done)");
          Scanner keyboard = new Scanner (System.in);
          int ID = keyboard.nextInt();
  
          if(ID == -1) {
              break;
          }
  
          students.put (currentID = ID, new ArrayList&lt;&gt;());
          editing = true;
  
          System.out.println("Enter courses: \n(Once you're done, type \'next\')");
  
          while (editing) {
              String course = keyboard.next();
              if(course.equalsIgnoreCase("next")) {
                  editing = false;
              } else {
                  students.get(currentID).add(course);
              }
          }
      }
  
      System.out.println ("Final List: ");
      students.forEach((key, value) -&gt; {
          System.out.println("Student " + key + ". Courses: " + Arrays.toString(value.toArray()));
      });
  }
  </code></pre>
  
  <hr>
  
  <p>The Program information that's expected:
  <a href="https://i.stack.imgur.com/IOqWJ.png" rel="nofollow noreferrer">enter image description here</a></p>