title: How do I remove the blue border highlight that appears when selecting a tab in a JTabbedPane?
body: <p>This is sort of a continuation of my <a href="https://stackoverflow.com/questions/21310260/how-to-create-a-buttongroup-with-connected-buttons-in-java">previous question</a>, but it addresses a specific concern that could be useful to someone else so I thought I would post it as a individual question.</p>
  
  <p>I have successfully created a JTabbedPane but there is an blue border highlight that shows which tab has been selected that I would like to remove:</p>
  
  <p><img src="https://i.stack.imgur.com/uWXp8.png" alt="Blue border highlight"></p>
  
  <p>To clarify what I mean here is a picture of a JTabbedPane without the blue border highlight from Eclipse:</p>
  
  <p><img src="https://i.stack.imgur.com/hvlN1.png" alt="Eclipse"></p>
  
  <p>The things I have tried have been commented out:</p>
  
  <pre><code>public class SeaGlassExercise {
  
      public static void initWindow() {
          JFrame frame = new JFrame("Application Name");
          CustomTabbedPane content = new CustomTabbedPane();
          frame.setContentPane(content);
          frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          frame.setLocationByPlatform(true);
  //                try {
  //                    UIManager.setLookAndFeel(
  //        UIManager.getSystemLookAndFeelClassName());
  //                } catch (Exception e) {
  //                    e.printStackTrace();
  //                }
  //                SwingUtilities.updateComponentTreeUI(frame);
          frame.pack();
          frame.setVisible(true);
      }
  
      public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run() {
                  initWindow();
              }
          });
      }
  
  }
  
  class CustomTabbedPane extends JPanel {
  
      public CustomTabbedPane() {
          super(new GridLayout(1, 1));
  
  //        UIManager.put("TabbedPane.contentAreaColor", Color.GREEN);
  //        UIManager.put("TabbedPane.light", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.highlight", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.shadow", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.darkShadow", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.selected", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.borderHightlightColor", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.borderHightlightColor", ColorUIResource.GREEN);
  //        UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0));
  
          JTabbedPane tabbedPane = new JTabbedPane();
          JComponent panel1 = makeTextPanel("Panel #1");
          tabbedPane.addTab("AAA", panel1);
          JComponent panel2 = makeTextPanel("Panel #2");
          tabbedPane.addTab("BBB", panel2);
          JComponent panel3 = makeTextPanel("Panel #3");
          tabbedPane.addTab("CCC", panel3);
          JComponent panel4 = makeTextPanel("Panel #4");
          tabbedPane.addTab("DDD", panel4);
          add(tabbedPane);
          tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
      }
  
      protected JComponent makeTextPanel(String text) {
          JPanel panel = new JPanel();
          JLabel filler = new JLabel(text);
          filler.setHorizontalAlignment(JLabel.CENTER);
          panel.setLayout(new GridLayout(1, 1));
          panel.add(filler);
          return panel;
      }
  }
  </code></pre>
  
  <h2>Additional Information</h2>
  
  <p>I am currently running my program with OS X Mountain Lion along with java version "1.7.0_25", Java(TM) SE Runtime Environment (build 1.7.0_25-b15). I am using the default look and feel (i.e. I have not specified anything with .setUI() in my code).</p>
  
  <p>Here are some questions I have looked at:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/2120728/controlling-color-in-java-tabbed-pane">Controlling Color in Java Tabbed Pane</a></li>
  <li><a href="https://stackoverflow.com/questions/3124474/jtabbedpane-set-default-border-around-tabs">JTabbedPane - set default border around tabs..?</a></li>
  <li><a href="https://stackoverflow.com/questions/5188411/remove-blue-color-from-jtabbedpane">remove blue color from JTabbedPane</a></li>
  </ol>