title: How can I remove border on JLabel?
body: <p>So I am trying to start a graphics program, where I have a JFrame that holds multiple JPanels. The JPanels need to combine to create 1 image, however when I run my program I see borders around the images. I cannot quite distinguish if the border is caused by the JLabel that holds the image or if it is because of the JPanel or because of the Layout Manager.</p>
  
  <p><em>How can I remove the border? Would i need to change the layout manager? If so how?</em></p>
  
  <pre><code>import java.util.*;
  import java.awt.*;
  import javax.swing.*;
  
  public class StarryNight {
      JFrame backGround;
      JPanel rootPanel;
      JLabel rootImage;
  
      public StarryNight(){
          backGround = new JFrame("Starry Starry Night");
          backGround.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          backGround.setResizable(false);
          backGround.setSize(1000,667);
          backGround.getContentPane().setBackground(Color.BLACK);
          backGround.setLayout(new BoxLayout(backGround.getContentPane(),BoxLayout.Y_AXIS));
  
          rootPanel = new JPanel();
          rootPanel.setSize(1000, 667);
          rootPanel.setBackground(Color.BLUE);;
          rootImage = new JLabel();
          rootImage.setIcon(new ImageIcon(getClass().getResource("Starry Night.jpg")));
          rootPanel.add(rootImage);
  
  
          JPanel jap = new JPanel();
          jap.setSize(1000,100);
          jap.setBackground(Color.GREEN);
  
          backGround.add(rootPanel);
          backGround.add(jap);
          backGround.pack();
          backGround.setVisible(true);
  
  
      }
  
      private static void runGUI()    {
          JFrame.setDefaultLookAndFeelDecorated(true);
          StarryNight ssn= new StarryNight();
      }
  
      public static void main(String args[]){
          javax.swing.SwingUtilities.invokeLater(new Runnable(){
              public void run(){
                  runGUI();
              }
          });
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/tYARR.jpg" alt="enter image description here"></p>