문제

Can someone give me advice on how can I the change tab (only in the tab itself, not the tab's content area) in JTabbedPane to an icon. It is possible to set another icon when the tab is selected, another icon on mouse over, and another icon when tab isn't selected. I'd like to have this icon on full tab width and height under the text, similar like when one replaces a whole button with an image.

도움이 되었습니까?

해결책

Take a look at setTabComponent, this will allow you to supply a custom renderer for that tab

You would then need to monitor changes to the tab selection via the changeListener, when the tab changes, you would use the getTabComponentAt method to get the renderer and update it

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top