title: Trying to get a jlabel to be completely removed/added to jframe through use of checkboxes
body: <p>I'm trying to use checkboxes so that 2 labels (or other objects) have the option to be completely removed or added through the use of a textbox at the top of the window in a jframe. I can manage to do it so they're not visible but want it so that they're removed and all of the other stuff moves up into place so to speak. This is my code so far...</p>
  
  <pre><code>import java.awt.*;
  import java.awt.event.*;
  import java.security.*;
  import javax.swing.*;
  
  public class Hasher extends JFrame implements ActionListener {
      String UserInput;
      private JTextField textInputField;
      private static JLabel MD5Hashed,MD5Label;
      private static JCheckBox MD5Check, SHA1Check, SHA256Check, FileCheck;
      private JFrame contentPane;
  
      public Hasher() {
          this.setTitle("Hasher");
          Container contentPane = this.getContentPane();
          contentPane.setLayout(new GridLayout(0,1) );
          contentPane.setBackground(new Color(88,148,202));
  
          //CheckBoxes
              JPanel mainPanel = new JPanel();
              mainPanel.setLayout(new BorderLayout());
              JPanel checkBoxPanel = new JPanel();
              MD5Check = new JCheckBox("MD5");
              MD5Check.addActionListener(new ActionListener() {
      @Override
                  public void actionPerformed(ActionEvent e) {
          boolean Visible = MD5Check.isSelected();
          if (Visible == true);{
              contentPane.add(MD5Label);
              contentPane.revalidate();
              contentPane.repaint();
          }
          if (Visible == false);{
              contentPane.remove(MD5Label);
              contentPane.revalidate();
              contentPane.repaint();
          }
                  }
              });
              checkBoxPanel.add(MD5Check);
              SHA1Check = new JCheckBox("SHA-1");
              checkBoxPanel.add(SHA1Check);
              SHA256Check = new JCheckBox("SHA-256");
              checkBoxPanel.add(SHA256Check);
              FileCheck = new JCheckBox("File Hashing");
              checkBoxPanel.add(FileCheck);
              mainPanel.add(checkBoxPanel);
              contentPane.add(mainPanel);
  
  
      //Row One : Entered data to perform hash on
          contentPane.add(new JLabel ("   Enter text to hash"));
          textInputField = new JTextField();
          //HashingProcess inputListener = new HashingProcess( );
          //textInputField.addActionListener(inputListener);
          contentPane.add( textInputField);
  
      //Row Three: MD5 hash is completed  
          MD5Label = new JLabel( "   Using MD5 the hash is: " );
          //contentPane.add( MD5Label);
          MD5Hashed = new JLabel( "??") ;
          contentPane.add( MD5Hashed );
  
      }
  
      public static void main(String[] args) {
          Hasher theWindow = new Hasher( );
          theWindow.setSize(400, 400 );
          theWindow.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
          theWindow.setVisible(true);
  
          }
  
  }
  </code></pre>