title: How to arrange my GUI in java
body: <p>Hello I'm trying to make a gui for my java program but I'm stuck. I have made my buttonPanel but I don't know how to do next. </p>
  
  <ul>
  <li>I also want that when I click the ADD button to open a new window.  </li>
  <li>And I don't know how to add on the right side of my buttons
  another panel in which I could list my students.</li>
  <li>And last thing under the panel that lists the stundents I would like to have some options to sort them ( like those with grades bigger than 5 etc).</li>
  </ul>
  
  <p>I have managed to make my buttonPanel but I don't know how to continue. Please help me.</p>
  
  <pre><code>import javax.swing.*;
  
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  
  @SuppressWarnings("serial")
  public class MySwingTry extends JFrame {
      JPanel buttonPanel;
  
  
      public MySwingTry() {
          buttonPanel = new JPanel(new GridLayout(8,0,5,0));
          JButton addButton = new JButton("Add student");
          JButton deleteButton = new JButton("Delete student");
          JButton printAllButton = new JButton("Print all");
          JButton printNrOfStudentsButton = new JButton("Print nr.");
          JButton writeButton = new JButton("Write File");
          JButton readButton = new JButton ("Read File");
          JButton serializeButton = new JButton("Serialize File");
          JButton deserializeButton = new JButton("DeserializeButton");
          BoxLayout boxLayout1 = new BoxLayout (buttonPanel, BoxLayout.Y_AXIS);
          buttonPanel.setLayout(boxLayout1);
          buttonPanel.add(addButton);
          buttonPanel.add(deleteButton);
          buttonPanel.add(printAllButton);
          buttonPanel.add(printNrOfStudentsButton);
          buttonPanel.add(writeButton);
          buttonPanel.add(readButton);
          buttonPanel.add(serializeButton);
          buttonPanel.add(deserializeButton);
          this.add(buttonPanel);
  
      }
  
  //  public void actionPerformed(ActionEvent event) {
  //      if (event.getSource() == myButton) 
  //          myLabel.setText("My button clicked");
  //  }
  
      public static void main(String[] args) {
          MySwingTry first = new MySwingTry();
          first.setTitle("First try");
          first.setSize(300,500);
          first.setDefaultCloseOperation(EXIT_ON_CLOSE);
          first.setVisible(true);
      }
  }
  </code></pre>