Change Color of Disable Tab in JTabbedPane

Hello Friends,
I have one JTabbedPane in my Application.
In that one Tab is Disable.
I want to change default Background and Foreground color of that tab.
Can u help me...
Thanks in Advance,
Nishith Shah.

hii,
please I can't find out any DisableColor or something similair for defaultTabbedPaneUI, please try (unselect)
package jtabs;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
public class TestTabbedPane extends JFrame {
    JTabbedPane tabbedPane;
    public TestTabbedPane() {
        tabbedPane = new JTabbedPane();
        tabbedPane.setPreferredSize(new Dimension(300, 200));
        getContentPane().add(tabbedPane);
        JPanel panel = new JPanel();
        tabbedPane.add(panel, "null");
        JTextField one = new JTextField("one");
        tabbedPane.add(one, "one");
        JTextField two = new JTextField("two");
        tabbedPane.add(two, "two");
        tabbedPane.setEnabledAt(2, false);
        /*UIManager.put("TabbedPane.contentBorderInsets", new Insets(0, 0, 0, 0));
        UIManager.put("TabbedPane.highlight", new Color(255, 0, 0));
        UIManager.put("TabbedPane.lightHighlight", new Color(0, 255, 0));
        UIManager.put("TabbedPane.darkShadow", new Color(0, 255, 0));
        UIManager.put("TabbedPane.shadow",new Color(0, 0, 255));
        UIManager.put("TabbedPane.light" ,  new Color(0, 255, 0));
        UIManager.put("TabbedPane.foreground", new Color(0, 0, 0));
        UIManager.put("JTabbedPane.font", new Font("Dialog", Font.ITALIC, 12));
        UIManager.put("TabbedPane.selected", new Color(255, 0, 0));
        UIManager.put("disable", new Color(255, 0, 0));
        UIManager.put("TabbedPane.selectHighlight" , new Color(0, 0, 0));*/
        //UIManager.put("TabbedPane.background",  new Color(0, 0, 0));
        //SwingUtilities.updateComponentTreeUI(tabbedPane);
        /*tabbedPane.setTitleAt(2, "<html><font color=" +
                (tabbedPane.isEnabledAt(2) ? "black" : "red") + ">" +
                tabbedPane.getTitleAt(2) + "</font></html>");*/
    public static void main(String args[]) {
        TestTabbedPane frame = new TestTabbedPane();
        frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
} value are from
import javax.swing.*;
import java.util.*;
public class GetUIManagerList {
    public static void main(String[] args) {
        UIDefaults defaults = UIManager.getDefaults();
        System.out.println(defaults.size() + " properties defined !");
        System.out.println("-----------------------------------");
        String[] colName = {"Key", "Value"};
        String[][] rowData = new String[defaults.size()][2];
        int i = 0;
        for (Enumeration e = defaults.keys(); e.hasMoreElements(); i++) {
            Object key = e.nextElement();
            rowData[ 0] = key.toString();
rowData[i][ 1] = "" + defaults.get(key);
System.out.println(rowData[i][0] + " ,, " + rowData[i][1]);
please could I ask camickr or DarrylBurke how to overide disabled label in JTabbedPane (without Shadows), with using their SwingUtils
... kopik                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Changing Colors of selected tab in JTabbedPane.

    Do someone has some code that can show how to
    change the color of the selected tab with JTabbedPane.
    I can change the other tabs colors with setBackground and setForeground, setBackgroundAt........ but it is the selected
    tab that will not change from the default grey color.
    thanks

    try this code, it works.
    public class TabBackgroundChange extends JFrame {
    private JTabbedPane tabPane = null;
    public static final Color selTabColor = Color.red;
    Color nonSelectedTabColor = null;
    public TabBackgroundChange() {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception ex) {
    ex.printStackTrace();
    tabPane = new JTabbedPane();
    tabPane.add("One", new JPanel());
    tabPane.add("Two", new JPanel());
    tabPane.add("Three", new JPanel());
    this.getContentPane().add(tabPane);
    this.setSize(200, 200);
    this.setVisible(true);
    tabPane.addChangeListener(new TabChangeListener());
    tabPane.setSelectedIndex(1);
    tabPane.setSelectedIndex(0);
    public static void main(String[] args) {
    TabBackgroundChange tabBackgroundChange1 = new TabBackgroundChange();
    private class TabChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent ce) {
    int iSelTab = tabPane.getSelectedIndex();
    Color unSelectedBackground = tabPane.getBackgroundAt(iSelTab);
    for(int i=0; i<tabPane.getTabCount(); i++) {
    tabPane.setBackgroundAt(i, unSelectedBackground);
    tabPane.setBackgroundAt(iSelTab, Color.red);
    }

  • Change color/font of tabs

    Is there a way to change the color or font of tabs, in Forms 6i, based on certain data in that data block.
    For example, I have a form with 8 tabs and 8 data blocks. Not all tabs have data. For the ones that have data I want to make a color (lets say blue) and the ones that have discipline I want to make that tab a different color (red for example).
    Is there a way to do this? I looked at set_tab_page_property, but did not see anything about color of the tab. I was able to set the enabled/disabled successfully, but in this case this will not help me.
    Thanks in advance.
    Sandeep.

    You can't change the font or color of a tab-page-"header". You can only change the text (maybe put the number of records in brackets behind the text)

  • Setting color for disabled tab pane header.

    How can I change the color of a tab header (in tabbed pane) that is disabled?
    Many thanks.
    Shay.

    I can sugest you to :
    -> create your own TableHeader, that you could draw it like you want
    -> Don't use the header, and define your own TableModel and the apparenece
    -> Use the setBackground method of JTableHeader
    -> Define your own Look And Feel

  • Change color of portal tab strip

    Hi.
    In EP versión nw04s sp 16 there is a bug in the theme editor, is not posible to modify the tab color in the standard portal tabstrip.
    The note 1150293 said that it should modify some css files, i do it but the tabs of standard tabstrip control do not change color...
    I have clear the portal cacher, open a new browser window, restart java server...
    any idea?
    thanks...

    Thanks Aditya... but i made the modifications in this manner... i have copied the css files in other directory, edit it, and, then, i put it manually in the corresponding directory...
    When, after that, i open the css files, it has the modifications than i made... but the standar tabstrip control remains with the same colors.
    Any other idea?
    Thank you very much and regards

  • Mnemonics not diabled on disabled tab of JTabbedPane

    Does anybody know a simple way around this? I have a JTabbedPane with a disabled tab that has a mneumonic key on it. Clicking the mneumonic (ALT-T in my example) goes to the disabled tab, which defeats the purpose of having it disabled (clicking the tab with the mouse works as expected). This is obviously an overlooked bug. Running 1.4_02. Thanks in advance.
    Sample code:
    import java.awt.event.KeyEvent;
    import java.awt.BorderLayout;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JTabbedPane;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    public class TabPaneExample extends JFrame
        /** Creates a new instance of TabPaneExample */
        public TabPaneExample()
            super("TabPaneExample");
            JTabbedPane tabpane = new JTabbedPane();
            tabpane.addTab("One", new JButton("Panel One"));
            tabpane.addTab("Two", new JButton("Panel Two"));
            tabpane.setMnemonicAt(0, KeyEvent.VK_O);
            tabpane.setMnemonicAt(1, KeyEvent.VK_T);
            tabpane.setEnabledAt(1, false);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(tabpane, BorderLayout.CENTER);
            getContentPane().add(panel, BorderLayout.CENTER);
        public static void main (String args[])
            TabPaneExample frame = new TabPaneExample();
            frame.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);     
            frame.setSize(280, 230);  
            frame.setVisible(true);
    }

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Bjtabbedpane+%2Bmnemonic+%2Bdisabled&col=javabugs&x=36&y=9

  • Change color of disabled JTabbedPane

    Hi everybody,
    I have a disabled JTabbedPane and now I need to change the color of the text in the Tab.
    Default it is a grey color.
    I know you normally can do something like:
    UIManager.set("ComboBox.disabledForeground", Color.red);But this isn&#8217;t working for a TabbedPane
    Somebody has any suggestions?
    Regards,
    Remco

    try this
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setLocation(300,200);
        setSize(400,250);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final JTabbedPane tp = new JTabbedPane();
        tp.addTab("tab 1",new JPanel());
        tp.addTab("tab 2",new JPanel());
        tp.addTab("tab 3",new JPanel());
        getContentPane().add(tp,BorderLayout.CENTER);
        JButton btn = new JButton("Disable/Enable \"Tab 2\"");
        getContentPane().add(btn,BorderLayout.SOUTH);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            tp.setEnabledAt(1,!tp.isEnabledAt(1));
            tp.setTitleAt(1,"<html><font color="+(tp.isEnabledAt(1)? "black":"red")+">tab 2</font></html>");}});
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Change Color on Sheet Tab's from value in Cell

    I have try this code but it seem's not to Work propperly
    Private Sub Worksheet_Change(ByVal Target As Range)
    '    If Range("F58") > 9 Then
    '         Me.Tab.ColorIndex = 3
    '    ElseIf Range("F58") = 8 Then
    '         Me.Tab.ColorIndex = 8
    '    ElseIf Range("F58") < 7 Then
    '        Me.Tab.ColorIndex = 10
    '    ElseIf Range("F58:F59") = 0 Then
    '        Me.Tab.ColorIndex = xlColorIndexNone
    '     Else
    '         Me.Tab.ColorIndex = xlNone
    '    End If
    'End Sub
    the options ill need is
    1 When cell F58 is over 8 then Tab change to GOLD color
    2 When Cell F58 (8) then Tab Change to Silver color
    3 when cell F58 is under 8 Then Tab Change to Bronze Color
    If no Number in F58 Then No Color

    Thanks to you for the Help i have made a litle Change into it and then it's WORK as it shoul
    your code.
    Private Sub Worksheet_Change(ByVal Target As Range)
         If Range("F58") > 8 Then
              Me.Tab.ColorIndex = 10
         ElseIf Range("F58") = 8 Then
              Me.Tab.ColorIndex = 8
         ElseIf Range("F58") < 8 And Range("F58") > 0 Then
             Me.Tab.ColorIndex = 3
         ElseIf Range("F58") = 0 And Range("F59") = 0 Then
             Me.Tab.ColorIndex = xlColorIndexNone
         End If
     End Sub
    My ode after the changes
    Private Sub Worksheet_Change(ByVal Target As Range)
              If Range("F58") > 8 Then
              Me.Tab.ColorIndex = 10
             ElseIf Range("F58") = 8 Then
              Me.Tab.ColorIndex = 8
             ElseIf Range("F58") < 8 And Range("F59") > 8 Then
             Me.Tab.ColorIndex = 3
         ElseIf Range("F58") = 0 And Range("F59") = 0 Then
             Me.Tab.ColorIndex = xlColorIndexNone
         End If
     End Sub
    Your Regards From Henrik-1 And Danish Dart Union

  • Change color of disabled button

    Hello,
    how can i change the color of a "diabled and greyed" button? I customized the button with new pictures for the true and false-state. but when the button is disabled and greyed then its always the same color: grey.
    Is it possible to change this color somehow?
    Thx for oyur help

    NewOne wrote:
    The problem is not the reference.
    The problem is the reference. The 'Controls[]' property of the cluster outputs an array of general control references. To use these you have to cast them to the right type so you can use them like you want:
    Ton
    Message Edited by TonP on 09-26-2006 04:10 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    example2.png ‏3 KB

  • How do I remove color from my tabs. There is no color plug-in shown on my plug-in list to disable.

    I want to remove the color on my tabs. There is no color add-on in my add-on list. However, in Cheevos for Firefox, there is a Tab Candy entry that is highlighted but no way of disabling it. How do you suggest I get rid of the Tab candy or the color tabs?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to change the background color of  a Tab Canvas

    Hi All,
    I accidentally changed existing background color of a tab Canvas to ' gray' which is not matching with main canvas (which has default).
    How can I change background color to default. Please help me.
    -Thanks

    In the property palette of the tab page, click on the "Background Color" property and click the "Inherit" button on the top of the property palette, this will revert the value of the property to the default when the tab page was created which is <Unspecified>.
    But if your tab page has inherited the color from a property class it will revert to what was specified in the property class.
    Tony

  • 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

  • Changing hover color for TabNavigator tabs

    I was able to change the background color of selected tab to
    Navy and the others to Medium Blue. The foreground color is set to
    White. The default color for the hover seems to be black, so when I
    pass over the selected tab you can not read the text.
    How do you change the hover color?

    Try setting the textRollOverColor of your selected tab style.

  • Tab control page label change color programmatically

    Hi everybody!
    I have a question about a tab control.
    I'm trying to figure out a way to programmatically change the  properties of the tab labels so the selected tab's label looks different to the others.
    I'd like to do this by changing aspects of it's font and it's color. But I can't find out how to access it either directly or by reference.
    I can get at the label string so if all else fails I could make the selected one all capitals!
    Am I missing something, or is this one of those things which can't be done?
    I'm using Labview 11.
    Regards,
    Jonathan.

    The link still works for me!
    Search the forum for "Tab Color".
    This does not change the text, but the tab color which is what I do to high light the selected tab.
    I use dark gray and light gray to help the user tell which tab is "active".
    Not exactly what you wanted.
    http://forums.ni.com/t5/LabVIEW/How-can-I-change-the-font-color-size-of-tab-controls/m-p/967920/high...
    http://forums.ni.com/t5/LabVIEW/Programmatically-changing-page-color-in-a-tab-control/m-p/840699/hig...
    http://forums.ni.com/t5/LabVIEW/tab-control-color/m-p/3062557/highlight/true#M873360
    Omar

  • Spry Accordions, Tabbed Panels, and Collapsible Panels: changing colors

    I wanted to alert everyone to a great new Community article published by our very own David Powers. The article details the various best practices and methods for changing the colors of Accordion, Tabbed Panels, and Collapsible Panels widgets, including tab backgrounds, borders, and so on.
    Here's the article:
    http://kb2.adobe.com/community/publishing/504/cpsid_50437.html
    Customization questions are pretty frequent in both the Spry and Dreamweaver forums. This new styling guide is sure to answer lots of peoples' questions.
    Furthermore, the appearance of such an article is a great example of how Community content can interact and live symbiotically with Adobe Help. We've linked directly to David's piece from our own customization pages for the Spry Accordion, Tabbed Panels, and Collapsible Panels widgets:
    Customize the Accordion widget
    Customize the Tabbed Panels widget
    Customize the Collapsible Panels widget
    Thanks a lot to David for hammering out this article.
    If you're interested in publishing Community articles of your own, you can download the Community Publishing AIR application and get right to work!

    The borders you see, are called outline, its a accesiblity feature of the browsers,
    Actually called 'focus' lines  :-)
    Here's an article about the Bluefocus lines seen in Safari.
    http://www.brunobergher.com/blog/2009/01/19/safaris-blue-focus-lines/
    Without creating a Spry widget myself right now to test, but I'm sure thata there is a 'focus' rule in the css...
    trying the
    {outline:none;}
    on that rule.

Maybe you are looking for

  • Can I See My Mac's DeskTop on the Apple TV?

    Can I See My Mac's DeskTop on the Apple TV ? (MY TV Sceen) Or Can I see My (Mac Book) Desktop On My TV through The Apple TV?

  • What is needed to do a remote trace?

    I am interested in logging events from Microsoft-Windows-HttpService on a remote machine. I'm in a corporate environment and all the computers use Windows Auth. I have access to the remote machine. Are there certain permissions that I need  in order

  • How to transfer music to new ipod

    my friends ipod nano(2gb) is not working in my computer...what's wrong?i tried upgrading my itunes...but still wont work...my ipod nano(1gb) is working ok and so is my sister's ipod shuffle...what could be the problem?

  • Upgrade NW7.0(Java Only) to NW7.1 CE/NW7.2 CE

    Hi, Does anybody know if there are any tools(SAPINST,JUP, etc.,) available in SMP(service market place) for upgrading NW7.0(Java Only) to NW7.1 CE/NW7.2 CE? Thanks, regards, Krishna

  • Is there a T61 model without an off-center screen?

    Is there a T61 model without an off-center screen? I need to buy another T61, but the off-center screen on my current T61 drives me nuts. Is the 14" off-center too? Will Lenovo correct this on future models? Thanks in advance!