title: How to Remove JFrame Border as to Let an Image Touch The Edge
body: <p>I had a friend make a background for the program I made so that it wouldn't look so plain, and I thought the best way to place the images would be to make a JLabel, fill it with an image, and set it to the size of the screen. This worked fine, except there is a small border around the JFrame and I can't get the JLabel to touch the edges of the frame. Thoughts? I have attached a picture.</p>
  
  <p><img src="https://i.stack.imgur.com/XGxjN.png" alt="Border Problem"></p>
  
  <pre><code>public class ProgramDriver extends JFrame {
  
  private JPanel contentPane;
  private static CardLayout cardLayout;
  private JTextField addGradeN;
  private JTextField addGradeD;
  
  /**
   * Launch the application.
   */
  public static void main(String[] args) {
      EventQueue.invokeLater(new Runnable() {
          public void run() {
              try {
                  ProgramDriver frame = new ProgramDriver();
                  frame.setVisible(true);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
  }
  
  //Global Variables 
  ...
      manager = new StateManager(gb);
  
      //JFrame Settings
      setTitle("Grade Book");
      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setBounds(100, 100, 656, 530);
      contentPane = new JPanel();
      contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
      setContentPane(contentPane);
      cardLayout = new CardLayout(0,0);
      contentPane.setLayout(cardLayout);
      setResizable(false);
  
      //Home Panel 
      final JPanel Home = new JPanel();
      contentPane.add(Home, "Home");
      Home.setLayout(null);
  
      JButton btnSeeGrades = new JButton("See Grades");
      ...
  
      //Grades Panel
      JPanel Grades = new JPanel();
      contentPane.add(Grades, "Grades");
      Grades.setLayout(null);'
  </code></pre>