I\'m adding icons to tabs but i want the ImageIcon fits all the tabComponent.
I found a solution, i don't know if it's the proper one, thanks to @camickr
tabbedPane.setUI(new SynthTabbedPaneUI(){
Insets insets =new Insets(0, 0, 0, 0);
@Override
protected Insets getTabInsets(int tabPlacement,
int tabIndex){
return insets;
}
});
UPDATE
I found another solution setting this property
UIManager.getLookAndFeelDefaults().put("TabbedPane:TabbedPaneTab.contentMargins", new Insets(0, 0, 0, 0));
You can try playing with the UIManager. Add the following at the start of your program before you start creating component:
UIManager.put("TabbedPane.tabInsets", new Insets(0, 0, 0, 0));
Of course not all LAF's may support this option. See UIManager Defaults for more information.