Reputation: 23
I tried most of the things to do this,using helps from this site,there have more related post about this question,but any of that questions not helped to me.
I need to change jtabbedpane
selected tab background color.i used this code to that,but nothing will happen
import java.awt.Color;
import javax.swing.UIManager;
public class TestTabcolor extends javax.swing.JFrame {
public TestTabcolor() {
initComponents();
UIManager.put("TabbedPane.selected", Color.Red);
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TestTabcolor().setVisible(true);
}
});
}
}
can anyone tell me how can i change selected tab color :) Thank you
Update: please don't set this question as duplicated,because that related questions not solved my problem
Upvotes: 2
Views: 2468
Reputation: 5862
Call this UIManager.put("TabbedPane.selected", Color.Red);
before initComponents();
Upvotes: 3