更改 Tab 和 JTable 之间的线条颜色

Change Color of Line between Tab and JTable

我正在自定义 JTabbedPane 的视觉外观,其中包含三个 JTables

虽然我成功地为选项卡的选择颜色着色,包括更改文本颜色,但我通过创建自己的 BasicTabbedPaneUI 更改了选项卡边框颜色。但是还有一根线,保持原样。此行位于选项卡和 table 之间。见下图:

我说的那行标有三个小红点。 这条线是什么?如果它是边界,它属于哪里?我没有找到设置其颜色的方法。我检查了JTable,他JTabbedPane,甚至JTabbedPane的组件。

为了展示我能够访问的内容,我将每个组件都涂成了绿色。

您可以看到,这条蓝线仍然存在。 有谁知道如何改变它的颜色? 删除它将是另一个 acceptable 选项。

可能TabbedPane.contentAreaColorTabbedPane.contentBorderInsets的顶部):

import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;

public final class BasicTabbedPaneColorTest {
  private JComponent makeUI() {
    //UIManager.put("TabbedPane.contentBorderInsets",  new Insets(10, 10, 10, 10));
    //UIManager.put("TabbedPane.contentBorderInsets",  new Insets(0, 10, 10, 10));

    UIManager.put("TabbedPane.contentAreaColor", Color.GREEN);
    UIManager.put("TabbedPane.highlight",        Color.RED);

    JTabbedPane tabs = new JTabbedPane();
    tabs.setUI(new BasicTabbedPaneUI());
    //tabs.setBackground(Color.ORANGE);
    //tabs.setOpaque(true);

    tabs.addTab("JTable", new JScrollPane(new JTable(20, 3)));
    tabs.addTab("JTree",  new JScrollPane(new JTree()));
    return tabs;
  }
  public static void main(String... args) {
    EventQueue.invokeLater(() -> {
      JFrame f = new JFrame();
      f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
      f.getContentPane().add(new BasicTabbedPaneColorTest().makeUI());
      f.setSize(320, 240);
      f.setLocationRelativeTo(null);
      f.setVisible(true);
    });
  }
}