well first of all let me explain what i mean, and what I'm intending to do, I already know (and did) that in order to modify the appearance of the tabs in a TabbedPane, i need to extend XTabbedPaneUI (X = Basic,or any TabbedPaneUI you wish to extend) and override certain methods of the tabbedPaneUI, and set the new UI as the UI that my tabbedPane is going to use (myTabbedPane.setUI(new MyNewTabbedPaneUI());
), for example, in the extension of the ui I can do this:
@Override
protected void paintTabBackground( Graphics g, int tabPlacement,int tabIndex, int x, int y, int w, int h, boolean isSelected ) {
Color bgColor = tabPane.getBackgroundAt(tabIndex);
//tabPane is the way the BasicTabbedPaneUI makes reference to the JTabbedPane that is making use of him
//Do the painting of the tab background
}
the first line inside the method (and the only one) will return the background color I set on the tab that is going to be painted (myTabbedPane.setBackgroundAt(0, desiredColor);
) and then I can work with that color inside my own implementation of TabbedPaneUI, but what should I do in order to add more information to each tab, for example the percent of background I want to be painted, or any kind of info that is not (it can't be) stored in the implementation of TabbedPaneUI, because is dynamic and depends on each individual tab, so I thought, well lets add that info inside each individual tab, and then realize that I don't know which kind of object a tab is and I have not been able to find out anywhere what kind of object a tab is, I'm afraid there is not such thing as a tab object in java, so any help to find that out, or to achieve what I'm trying to do? (add more information to each tab, or to the JTabbedPane itself in order to have more data to work with while painting the tabs?)
P.S: I know it might be a bit confusing, so please any doubt about what I'm trying to explain just comment