I am using a JTabbedPane in my application. I have added two tabs which are instances of a custom class “ContentPanel”. This extends JPanel and sets the background, border etc etc. Basically it means I dont have to set the properties of each JPanel I want to apply this colour scheme to. I notice that not only does their border appear but another border (which, I think, is blue – at least on my screen) appears around this border, connected to the tab “selectors” themselves (i.e. the buttons you click on to get the appropriate view). I would like to change this border as it just looks odd against a gold / brown colour scheme. Does anyone have any idea how to do this? I have tried JTabbedPane.setBorder(Border b) but that doesnt work. That simply sets a border around the entire thing, including the tab selectors.. not what I want.
Any help with this would be greatly appreciated.
These colors are defined in the Look and Feel. If you look at the code for
BasicTabbedPaneUI, you will notice thatinstallDefaults()sets a bunch ofprotected Colorinstance variables. The keys they are defined against in the L&F are also available here.If you do not want to go as far as define your own L&F, you have the ability to set a custom UI delegate on your tabbed pane:
you may of course want to change those color settings. As set, you will see which vars are used where.