Changing the Color of Default Tab window - of JTabbed APIany ideas?

hi all
as you know using JTabbedPane the selected tab is grey by default.
How can i make all selected tabs a color instead of grey ?
Stev

thanks for sharing with me the solution.
however I don't understand how to implement what you shared.
I have a few quick questions.
1. What does LAF stand for ?
2. How do I (or can I) specify either Windows versus Metal ? (i'll show some code of what i have below)
3. After I put the color in the hashtable how do I use it ?
Here's what I have -- i got it from the web .
public class MnemonicTabbedPaneExample extends JPanel {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.getContentPane().add(new MnemonicTabbedPaneExample());
frame.setSize(700,400);
frame.setBackground(new Color(255, 215, 0));
frame.setVisible(true);
frame.addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent e ) {
System.exit(0);
} //end main
//the constructor
public MnemonicTabbedPaneExample() {
setLayout (new BorderLayout());
MnemonicTabbedPane tabbedPane = new MnemonicTabbedPane();
String[] tabs = {"tab1", "tab2", "tab3", "tab4", "tab5"};
for (int i=0;i<tabs.length;i++) {
tabbedPane.addTab(tabs, createPane(tabs[i],GOLD ) );
tabbedPane.setBackgroundAt(i, GOLD );
tabbedPane.setSelectedIndex(0);
add(tabbedPane, BorderLayout.CENTER);
}//ends constructor
JPanel createPane(final String string, Color color) {
JButton abcButton = new JButton("Abc");
abcButton.setMnemonic('A');
JButton xyzButton = new JButton("Xyz");
xyzButton.setMnemonic('X');
//here is the main panel
JPanel p = new JPanel();
p.setBackground(color);
p.add(new JLabel(string));
p.add(abcButton);
p.add(xyzButton);
return p;
private Color GOLD = new Color(255, 215, 0);
/// here is my JTabbedPane class
public class MnemonicTabbedPane extends JTabbedPane {
Hashtable mnemonics = null;
int condition;
public MnemonicTabbedPane() {
setUI(new MnemonicTabbedPaneUI());
mnemonics = new Hashtable();
setMnemonicCondition(WHEN_IN_FOCUSED_WINDOW);
class MnemonicTabbedPaneUI extends MetalTabbedPaneUI {
protected void paintText(Graphics g, int tabPlacement,
Font font, FontMetrics metrics, int tabIndex,
String title, Rectangle textRect,
boolean isSelected) {
g.setFont(font);
     UIManager.put("TabbedPane.selected", Color.red );
MnemonicTabbedPane mtabPane = (MnemonicTabbedPane)tabPane;
if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) {
g.setColor(tabPane.getForegroundAt(tabIndex));
     BasicGraphicsUtils.drawString(g,title, mtabPane.getMnemonicAt(tabIndex),
               textRect.x,
               textRect.y + metrics.getAscent());
} else {
g.setColor(tabPane.getBackgroundAt(tabIndex).brighter());
     BasicGraphicsUtils.drawString(g,title, mtabPane.getMnemonicAt(tabIndex),
               textRect.x,
               textRect.y + metrics.getAscent());
g.setColor(tabPane.getBackgroundAt(tabIndex).darker());
     BasicGraphicsUtils.drawString(g,title, mtabPane.getMnemonicAt(tabIndex),
               textRect.x - 1,
               textRect.y + metrics.getAscent() - 1);
}//end if
}//end method
}//end class
any idea on how i would make the selected Tab Red ?
Thanks in advance . putting it in the UIManager hashtable - is interesting but i'm not sure what to do after that. compilling and running doesn't let it work.
stev

Similar Messages

  • How can I change the color in a search window for visited sites? I'm partially color blind and the default colors are very difficult to tell from one another.

    When I'm looking at a search engine results page, I would like the colors of visited results to be a color that is much more different than they are now. Like blue v.s. black or blue v.s. yellow.

    You can use the NoSquint extension to set font size (text/page zoom) and text color on web pages, including the visit color.
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • How can I change the color of a new window?

    Every time I open a new tab the whole screen is pink. How can I change this?

    Subclass DefaultTableCellRenderer.
    public class MyCellRenderer extends DefaultTableCellRenderer
    Override
    public Componet getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    JLabel lab = new JLabel(String)value);
    lab.setOpaque(true);
    return lab;
    if(isSelected)
    lab.setBackground(Color.red);
    else
    lab.setBackground(Color.white);
    Set the columns in your table:
    table.getCoulumModel.getColumn(0).setCellRenderer(new myCellRenderer());
    table.getCoulumModel.getColumn(1).setCellRenderer(new myCellRenderer());
    etc. for each column in your table.

  • I would like to know how to change the color scheme of my tabs. They are dark grey with a lighter grey print and are hard to read. How do I make them different colors?

    When I open Firefox, the tabs for the homepages are dark grey and the print is a lighter grey but they are hard to read. How can I change the color of these tabs and fonts?

    This is a customer to customer forum, so this is not the place.
    What is going on with your account? maybe we can help you.

  • How do I change the color of the back and forward arrow to green

    In Windows 7 the color of the back and forward page arrow is blue.
    On my desktop computer using Windows XP the color of the back and forward page arrow is green. This is much easier on my eyes.
    Is there a way to change the color to green in Windows 7?

    Firefox on Windows XP uses a different default theme than Firefox on Vista & 7. Try using the [https://addons.mozilla.org/en-US/firefox/addon/7119/ XP on Vista] theme, this should replicate the XP theme on Windows 7.

  • After i changed the setting in application tab in options : open pdf doc by adobe by default, the "Ask" window still pop up every time. How to fix this ?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/913026]]</blockquote>
    after i changed the setting in application tab in options : open pdf doc by adobe by default, the "Ask" window still pop up every time. How to fix this ?

    How do I fix this problem ...javascript (cid) applications.

  • When I change the color using windows 7 color, I get a prompt to change back to firefox default or everything is very slow. Isn't there another way to fix the i

    When I change the color using windows 7, apparently firefox runs slower. The videos I watch are spotty and looking like it's in slow motion. Sometimes I get a prompt to use firefox colors and this fixes it. But why can't I use other colors, and are there settings to help me fix this problem? Thank you for any information you can give me. Joyce

    Try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://hacks.mozilla.org/2010/09/hardware-acceleration/
    You can check for problems caused by recent Flash updates and try these:
    *disable a possible RealPlayer Browser Record Plugin extension for Firefox and update the RealPlayer if installed
    *disable protected mode in Flash 11.3 and later
    *disable hardware acceleration in the Flash plugin
    *http://kb.mozillazine.org/Flash#Troubleshooting

  • How can I change the color of the new tab button?

    Hi,
    I was wondering if there was a way to change the color of the new tab button, list all tab button, and tab groups button. I have been searching for personas that don't make it hard to see those particular buttons for days now, but since I can't seem to find any I was hoping there was a way to change those buttons' colors to make them more visible with the personas.
    [http://i54.tinypic.com/2ui9351.jpg Here's a picture of the situation]
    I want to change those 3 buttons (and the "show more bookmarks" button that appears when the window is too small to show them all) to white or some other more visible color. I know there's a way to change the background of those buttons, but I'd prefer if I could change the '+' button itself in the new tab button for example. Is there any way to do it? Because it's so hard to find personas that don't make it hard to see text or buttons.
    Thanks.

    jus an example
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    Blinking_Indicator_2003.vi ‏27 KB

  • Is it possible to change the color of the main toolbar and tabs in Safari?

    I was wondering if there is a way to change the color of the gray toolbar/tabs in Safari?
    Thanks.

    HI Chris,
    No, sorry.
    Carolyn

  • Is it possible to change the colors of the tabs in the pannelTabbed comp

    Hi Experts,
    Is it possible to change the colors of the tabs in the pannelTabbed component.
    suppose for the selected tab we need white color and non selected we need brown color.
    How can we achive this using ADF.
    Regards
    Gayaz

    [url http://download.oracle.com/docs/cd/E14571_01/web.1111/b31973/af_skin.htm#BAJFEFCJ]skinning

  • When creating a fillable form and saving it as a pdf, the default color of the data fields is a light blue. How do I change the color to something else that will copy better, e.g. a light yellow?

    When creating a fillable form and saving it as a pdf, the default color of the data fields is a light blue. How do I change the color to something else that will copy better, e.g. a light yellow?

    It's probably the fields highlight color of the application, which you can change via Edit - Preferences - Forms.

  • How do I change the color of the area next to the Tab Bar

    I've got Firefox 8.0, and ever since they went to the new layout I've had problems with the area at the right of the Tab Bar. When FF is maximized, the buttons up there ( > + ▼ X ) are black on a dark blue background, and I almost can't see them - so I never use it maximized.
    How do I change the color, maybe back to the colors it uses when not maximized?

    I got used to the tabs at the top -- and kinda prefer that look, but I'll try this for a while.
    Is there any way to change the color of either the buttons or the background?
    Thanks.

  • CLAF - How to just change the color-scheme of default laf of Oracle EBiz

    How to change the color scheme of the default oracle ebusiness suites laf?
    When we tried the CLAF UI, there is no option to extend the oracle-desktop.xss.
    It gives only the base-desktop (which is different from the default Oracle Ebusiness laf).
    Have anyone done this ?
    Any suggestions/help is appreciated..?

    the default LAF is Browser one and the OA personalization guide tells what we can't extend it.
    It reads so stupid what i was not able to believe it.. But seems true.
    When you need to make a simple modification and keeping the look and feel, you can't.
    I changed only one icon but you can't give blaf (even if you modify the extends property in the look and feel metadata.xml
    Had you try to copy all blafs styles in your BLAF ? (that could be a workaround even if is it not upgradable ?)
    Or, open SR ?
    Anyway, I'm interesting by an answer too.
    Regards

  • TS3999 When using iCloud Calendar, I am unable to change the color of my work calendar. I have successfully followed the instructions to reset the colors of other calendars as desired. However, this one calendar always defaults to purple.  Help!

    When using iCloud Calendar, I am unable to change the color of my work calendar. I have successfully followed the instructions to reset the colors of other calendars as desired. However, this one calendar always defaults to purple.  Help!

    File>New Calendar to create a new calendar (Groups are for grouping calendars and I should ignore them). When you've created the calendar, control-click on it in the sidebar and choose 'Get Info' There you can select a colour. You can have as many calendars as you like. When you create a new event you can select the calendar it belongs to, and hence the colour it has.

  • Change the Colors of Expand, Minimize and Close Window Buttons

    How do I change the colors of the Expand, Minimize and Close window buttons?
    Red, green, and yellow are not conducive to red-green colorblind individuals, and the gray scheme in the Graphite appearance is too dull.

    If the change in theme can do it, there must be an alternative.

Maybe you are looking for

  • Inbound Delivery For Scheduling Agreement Lines using LSMW

    Hi, We need to create inbound deliveries for scheduling agreements. Our scheduling Agreements are too big with 200 lines. But the vendor used to send only few discrete lines in his ASN. Is it possible to create inbound deliveries for the Scheduling a

  • My phone is not working whatever i do

    hi, my problem started as short life battery then one day my phone shut off and didnt work again no matter how long i conect it to the charger or take out the battery and SIM card and re install them, and when i connect it to the discktop software no

  • Service PO Creation With Negative value

    Hi all, I am trying to create a Services PO using the BAPI 'BAPI_PO_CREATE1' In my scenario, First time PO will create with negative value. Then I will remove some conditions in Services line. Then PO value will becomes positive. When i create the ba

  • In Acrobat Reader DC for Android, how do I prevent Verizon Cloud from launching when clicking the floating action button to retrieve files?

    I have a Verizon-branded Samsung Galaxy S5, which means a lot of Verizon apps were added from the factory install. Recently I upgraded Adobe Acrobat Reader to its most recent version. When I clicked on the floating action button to open a PDF, it lau

  • Reg - Deployment Error in NWDS7.0

    Hi All , Im trying To Deploy Web Dynpro Sample Application By Creating project Name and Application and Iview . When im try to deloy the application  after giving SDM Pasword it throws Following Error . please suggest Valueble inputs . com.sap.tc.web