Colorize a tab in a JTabbedPane using java swing

后端 未结 4 1077
孤街浪徒
孤街浪徒 2021-01-15 03:24

I am trying to change the background color of my tabs in a JTabbedPane. I tried JTabbedPane.setBackgroudAt(0, Color.GRAY) and JTabbedPane.set

4条回答
  •  抹茶落季
    2021-01-15 04:06

    • most of method for JTabbedPane is protected in the API, and not accesible from Swing methods

    • have to look for Custom XxxTabbedPaneUI, override these methods, and could be accesible from outside

    • correct way would be to implement Custom Look & Feel only, part of them override JTabbedPane

    • example for Custom XxxTabbedPaneUI

提交回复
热议问题