雨云外观和感觉JTabbedPane选项卡背景颜色

时间:2014-09-27 16:29:29

标签: java swing look-and-feel nimbus

我想更改标签后面的白色背景。我试图在UIManager中设置不同的UIDefaults无济于事。我想改变tabbedpane内的面板会做到这一点,但它也没有。有谁知道怎么做?

EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
                UIDefaults defaults = UIManager.getLookAndFeelDefaults();
                defaults.put("Table.gridColor", new Color (214,217,223));
                defaults.put("Table.selectionBackground", new Color(250,235,215));
                defaults.put("Table.selectionForeground", Color.BLACK);
                defaults.put("TabbedPane.background", new Color(175, 238, 238));

                MainWindow frame = new MainWindow();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });

Modify the White Background behind the Row of Tabs

1 个答案:

答案 0 :(得分:1)

这只是父组件的背景颜色。例如,如果组件直接添加到JFrame

frame.getContentPane().setBackground(Color.RED);