Color of the selected tab in  a tabbedpane

I wander if anyone knows how to change the color of a tab when it is selected. I have tried to use; "tabbedPane.setBackgroundAt(1,rgdcolor)" , where 1 is the tab chosen and rgb is my predifined color, but the color of the tab stays unchanged.
/anna

Here is some code that will display all the UIManager properties and the default values.
import javax.swing.*;
import java.util.*;
public class ShowUIManager {
    public static void main(String[] args) {
        UIDefaults defaults = UIManager.getDefaults();
        System.out.println("Count Item = " + defaults.size());
        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[ i ] [ 0 ] = key.toString();
            rowData[ i ] [ 1 ] = ""+defaults.get(key);
            System.out.println(rowData[0]+" ,, "+rowData[i][1]);
JFrame f = new JFrame("UIDefaults Key-Value sheet");
JTable t = new JTable(rowData, colName);
f.setContentPane(new JScrollPane(t));
//f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);

Similar Messages

  • Tab Set Label Colors - How do I change the selected tab label color?

    No matter what color I tell it to use for the Labels - Selected color I get white.  Is this a known bug in the system or am I not doing something correct.  I have a tab set component and a label based menu selector component on my display.  I've set up the labels and backgrounds for both components exactly the same but I can only get white for the selected tab set label.
    Edited by: Maureen LaComb on Feb 19, 2009 5:38 PM

    Hi, Maureen
    You can set the color of Tab Set by using the Following Steps.
    --> Select the Tab Set
    --> From the the Properties Window
    --> Select Appearance
    --> There are Two Tabs "Text" and "Color"
    --> From the Color Tab you can Select the Background Color
    --> Tab BackGrounds Or Labels from here you can select the color.
    But this setting will Apply to all the Tabs in a Tab Set, I think you can't set the Specific Setting for a single Tab in a Tab Set.
    Please Reply if any Issue,
    Kind Regards,
    Faisal

  • 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

  • How do I change to background color in the open tabs; currently grey with black text, hard to read.

    In FF 4.0 can I change the background color of the open tabs. Currently it is grey with black type. A lighter background would be easier to read.
    Thanks, TJH

    Download this addon: https://addons.mozilla.org/en-us/firefox/addon/stratiform/ It allows you change the color of the tabs, plus many other options.

  • Why isn't the selected tab title bold in JTabbedPane? How can I make it be?

    The selected tab title of JTabbedPanel is not bold. Is there a simple way to set it to be bold when a tab is selected? Thanks in advance.

    1. Simply use the HTML code in it's text like '<html><b>NameOfThisTab</b></html>'.
    2. Extend the JTabbedPane and fine-tune the font it uses.

  • How to change the selection background color of the selected item in the popup menu of the choice box ?

    How to change the selection background color of the selected item in the popup menu of the choice box ?
    By defaut, the selection background color likes "blue", but if I want it to be "yellow" for example, how should I do ?
    Thanks

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

  • Changing JList non-editable Font color of the selected items

    Hi All,
    I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.
    Could you please clarify me?
    <img src="file:///C:/DOCUME~1/sgnanasi/LOCALS~1/Temp/moz-screenshot-4.png" alt="" />

    [email protected] wrote:
    ..I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.Set a custom [cell renderer|http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html] *(<- link)* for the JList.

  • Driver does not appear in the selection tab Windows8

    NDIS protocol driver does not appear in the Selection Tab and hence I can not run any tests on it. The client operating system is Windows 8 64bit Pro Premium. I tried reinstall driver several times, reboot client and studio machines, but with no results.
    Client itself is connected to the studio and is in "Ready" state.
    There was no problem running the test on the same driver with Win7 64bit client OS.
    HCK version is 8.59.29854
    The driver is build with DDK7.1.0
    Any hints on how to debug this would be helpful.
    Dmitry

    Have you uninstalled and re-install the HCK client on the test system?  This can cause the entry on the controller to not match up with the actual client system.  If this is the case, and you have done no testing on the system (as all results will
    be lost), please try this:
    1) Uninstall the DTM client from the test system.
    2) Delete the client entry from HCK studio in the machine management section.
    3) Reinstall the DTM client on the test system.
    4) Wait for client entry appear in the "Default Pool"
    5) Change client status to "Reset", wait for it to become "Ready", and try locating the target as I describe above.
    Paul - This posting is provided "AS IS" with no warranties, and confers no rights.

  • Changed the color of the selected text

    I changed the color of the selected text in Photoshop CS6, from black (background) & white (text) to different colors. I want to know how I did it.

    Selecting tends to invert the text. Use Ctrl/Cmd h while in Text edit mode to hide the selection.

  • Recovering the selected tab of  a TabStrip UI Control

    Hi forum:
         Hi have a trabStrip control with some diferents id´s in their tabs and also onSelect action of this tabstrip i want to recover the id of the selected tab, but the selected tab can be only recover from the wdDoModifyView , how can i do this, if the wdDoModifyView is static and my onSelect method is non-static?
    Thnks
    Joshua

    Hi Josue,
    you can simply map tabstrip "selectedTab" property to context atribiute and use it enywhere you want:) (b.e. in onSelect event handler)
    Regards Bogdan

  • How to change the default color of the selected row

    hi all,
    I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
    thanks and regards,
    rpk

    The chart colors are being referred to *'palette.cxml'* file in these directories
    BI_HOME\web\app\res\s_oracle10\chartsupport
    BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
    you can change to your custom colors.
    Restart OC4J and PS to make the new ones work..
    Regards,
    Raghu

  • Retaining the selected tab in a tabbed block of selection screen

    Hi,
    My report has a selection screen with a tabbed block displaying 3 tabs. I want to retain the tab that was selected before executing the report and display that tab as the activetab when the user back navigates from the output list of the report to the selection screen.
    I tried to store the value of 'activetab' component of the tabbed block in a global variable and assigned the global variable to the 'activetab' component. But it is not working.
    Is there any other way by which we can do this?
    Thanks and Regards,
    Tongston

    I had a similar problem some time ago. One clarification first, global variables will not work because when you come back from report output, all the global/local variables are initialized that is when you come back to selection screen from report output, it is like a new instance of report.
    To resolve this you can use Export to memory ID / Import from memory ID statements, as these will retain the data across report instances.
    Now the following code is doing exactly what you wanted. You should copy/ paste it in an abap program and run it to see for yourself how I retained active tab.  Hope this will help you.
    REPORT  yy_test002.
    TABLES: bkpf, bseg, glt0, fdes, lfa1.
    DATA: g_acttab(132) TYPE c.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS: p_bukrs LIKE bkpf-bukrs,  "obligatory,
                p_upto LIKE bkpf-budat.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
    SELECT-OPTIONS: s_hkon1 FOR bseg-hkont NO-EXTENSION,
                    s_lifn1 FOR bseg-lifnr.
    SELECTION-SCREEN END OF SCREEN 101.
    SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
    SELECT-OPTIONS: s_hkon2 FOR bseg-hkont NO-EXTENSION,
                    s_lifn2 FOR bseg-lifnr.
    SELECTION-SCREEN END OF SCREEN 102.
    SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
    SELECT-OPTIONS: s_hkon3 FOR bseg-hkont NO-EXTENSION,
                    s_lifn3 FOR bseg-lifnr.
    SELECTION-SCREEN END OF SCREEN 103.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME.
    PARAMETERS: p_dued LIKE bseg-fdtag.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tbblk FOR 8 LINES.
    SELECTION-SCREEN TAB (18) tabname1
    USER-COMMAND 'UTB1' DEFAULT SCREEN 101.
    SELECTION-SCREEN TAB (18) tabname2
    USER-COMMAND 'UTB2' DEFAULT SCREEN 102.
    SELECTION-SCREEN TAB (18) tabname3
    USER-COMMAND 'UTB3' DEFAULT SCREEN 103.
    SELECTION-SCREEN END OF BLOCK tbblk.
    SELECTION-SCREEN END OF BLOCK blk2.
    INITIALIZATION.
      tabname1 = 'GL Accounts set 1'.
      tabname2 = 'GL Accounts set 2'.
      tabname3 = 'GL Accounts set 3'.
      IMPORT g_acttab FROM MEMORY ID 'zssfsdfr3'.
      IF sy-subrc = 0.
        tbblk-prog = sy-repid.
        tbblk-activetab = g_acttab.
        CASE g_acttab.
          WHEN 'UTB1'.
            tbblk-dynnr = 101.
          WHEN 'UTB2'.
            tbblk-dynnr = 102.
          WHEN 'UTB3'.
            tbblk-dynnr = 103.
          WHEN OTHERS.
        ENDCASE.
      ENDIF.
    START-OF-SELECTION.
      g_acttab = tbblk-activetab.
      EXPORT g_acttab TO MEMORY ID 'zssfsdfr3'.
      WRITE:/ 'current active tab:', g_acttab.
      WRITE:/ 'bye'.

  • Setting the background color of the selection when text selected (input TextField)

    My input TextField has a black background. The problem is,
    when some text is enter and then selected, the selection background
    color remains black and the selected text remains white. Because of
    this it's imposible to tell that the text has been selected. Is
    there a way to change the selection background color, or do I
    really have to write a custom textfield? :(

    Yes, I do have an additional attribute called "identity" which is set to the original table where it came from. The problem is that I do not know how to check for it in my renderer. I will post my renderer code here
    public class myTableRenderer extends DefaultTableCellRenderer{
    public Component getTableCellRendererComponent( JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column) {
    final Component component = super.getTableCellRendererComponent(table, value,isSelected,hasFocus, row, column);
    if ( value != null ) {
    if ( value instanceof String ) {
    String val = value.toString();
    if ( val.compareTo("DisplayKnown") == 0 ) {
    component.setBackground(Color.CYAN);
    else
    component.setBackground(Color.LIGHT_GRAY);
    } // end if value not null
    return component;
    } // end mytablerenderer
    What happens here, is that only the column with the identity value "DisplayKnown" gets the color blue. I would like to color the whole row with that column value to be Blue.
    Does this make sense??
    Thanks,
    npatel

  • JComboBox : colors in the selected value field

    I have a JComboBox with a custom ListCellRenderer. However the JComboBox seems to change the colors of the Component that my ListCellRenderer creates when the Component is in the Selected value field. Some code is below...
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    public class ComboBoxTest {
      public static final void main(String[] args) {
        JComboBox cbox;
        Vector elements;
        elements = new Vector();
        elements.add("One");
        elements.add("Two");
        elements.add("Three");
        cbox = new JComboBox(elements);
        cbox.setRenderer(new MyRenderer());
        cbox.setEditable(false);
        JFrame frame = new JFrame();
        JPanel content = (JPanel) frame.getContentPane();
        content.add(cbox);
        frame.pack();
        frame.setVisible(true);
    class MyRenderer implements ListCellRenderer {
      public Component getListCellRendererComponent(
        JList list,
        Object value,
        int index,
        boolean isSelected,
        boolean cellHasFocus)
        String strValue;
        JLabel label;
        strValue = (String) value;
        label = new JLabel("<" + strValue + ">");
        label.setOpaque(true);
        if( isSelected ) {
          label.setForeground(Color.black);
          label.setBackground(Color.green);
        } else {
          label.setForeground(Color.white);
          label.setBackground(Color.black);
        return label;
    }This code simply creates a JComboBox with 3 String values, "One", "Two", and "Three". The renderer creates a JLabel with the String value enclosed in triangle brackets. The renderer also sets the colors of the JLabel to white on black if unselected and black on green if selected.
    When I run this program, the list portion of the JComboBox looks correct, but the entry in the edit field is wrong. It has the enclosing triangle brackets around the selected String, but the colors are still the default black on gray.
    What do I need to do to get the colors in the edit field to display correctly?
    - James

    A JComboBox is similar to a JSpinner in the sense that it has an associated editor that has an associated textfield....check out the link shown below
    http://forum.java.sun.com/thread.jsp?forum=57&thread=385077
    ;o)
    V.V.

  • Supertabbar not focusing the selected tab's canvas

    Hi,
    I have a buttonscrolling canvas, and on it there is a Hi,
    I have a buttonscrolling canvas, and on it there is a supertabbar.  I have a lot of tabs on it, more than what can fit in a screen, so in order to scroll to the tabs at the end i have to use the button to navigate to the right or left.
    What is the correct way to set focus/activate the currently selected tab and get it into view?

    Yes, the items are in a frame.
    Both automatically and locked for the frame upate layout property causes the problem.
    I want to tell that the form in run time is ok, but in the forms builder the text items are not in their specified positions.
    Then when changing any property for the items even if it was not related to the item position, the item is then displayed in the correct position.

Maybe you are looking for

  • Taking too long time to get LOV

    HI, I have created a customer folder in which the query retuns 0.5 million records. I have created a item class in airline_name column which is being used in the worksheet as parameter. The problem is it is taking too long time near about 2 min to ge

  • IPod nano charges but is not recognized

    Good morning. Im writing this topic, because I saw all the topics about this same problem, and none of them solved mine. I hope you can help me on this, so here is the thing: When I connect my iPod to the 2.0 usb port, the ipod lights its screen, cha

  • Why won't it (simple dataset) work!

    I'm trying to use spry to open a simple xml file. But all I get are the table headings. This is the xml: <xml version="1.0" encoding="UTF-8"> <dtable name='table1'> <datum> <name>Robby</name> </datum> <datum> <name>Bob</name> </datum> </dtable> </xml

  • Strange Problem-------Call to Gothics of STRUTS

    I m developing application on STRUTS frameork. evrything is working fine , except for one thing. Im having a dyna sction form , but when i invoke editQuestion.do it gives me 500 error. Can anybody find out why , it so ? One more thing if i create one

  • Downgrade from 30.0.018 back to 20.0.016 can it be...

    hello to all of you here i'm new in here. i have NOKIA N95 8GB & did an upgrade to the new version 30.0.018 now i want to go back to the old frimware that i hade  20.0.016 (problems with the new ver) can i do it? Please help me with that..... Thanks,