Rounak
Rounak

Reputation: 89

java swing set background color of whole tabbedpane

My problem is described in this image:

Upvotes: 3

Views: 791

Answers (1)

Korhan Ozturk
Korhan Ozturk

Reputation: 11308

If setBackground(Color.x) function didn't work for you, you can try setBackgroundAt() function as in TabComponents demo

private void initTabComponent(int i) {
    pane.setTabComponentAt(i, new ButtonTabComponent(pane));
    pane.setBackgroundAt(i, Color.orange);
}

Note: Make sure that the target component is opaque

Upvotes: 1

Related Questions