I am using JidetabbedPane.
I have a CloseButton on tab. I have changed the foreground color of CloseButton by extending the NoFocusButton class.
But that will change the color for everytab
I would like to have the different foreground color of CloseButton when tab is not selected.
Is this possible?
here is my code
- Code: Select all
@Override
public NoFocusButton createNoFocusButton(int arg0) {
return new ExtendedNoFocusButton(arg0);
}
public class ExtendedNoFocusButton extends NoFocusButton {
public ExtendedNoFocusButton(int type) {
super(type);
}
@Override
public void setOpaque(boolean isOpaque) {
super.setOpaque(true);
}
@Override
public void setBorder(Border border) {
super.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 2));
}
@Override
protected Color getForegroundColor() {
return Color.GREEN;
}
@Override
protected Color getShadowColor() {
return Color.BLACK;
}
@Override
protected Color getPressedShadowColor() {
return Color.BLACK;
}
@Override
public void setBackground(Color bg) {
super.setBackground(Color.BLUE);
}
}
Thanks in advance