Can't change the color of a JComboBox even if  I change its ComboBoxEditor

I need the text of my ComboBox to be red when it is disabled.
I have tried the following piece of code:
JComboBox itsComboBox = new JComboBox();
itsComboBox.setEnabled(false);
Color foreground = Color.RED;
itsComboBox.setForeground(foreground);
itsComboBox.getEditor().getEditorComponent().setForeground(foreground);
However it does not work does any one have any other suggestions?

Work fine for me...
import java.awt.*;
import javax.swing.*;
public class DisabledTextColorTest {
   public static void main(String[] args) {
      EventQueue.invokeLater(new Runnable() {
         public void run() {
            new DisabledTextColorTest().makeUI();
   public void makeUI() {
       String[] option = {"hello"};
       JComboBox t = new JComboBox(option);
       ((JTextField)t.getEditor().getEditorComponent()).setDisabledTextColor(Color.RED);
       //t.setEditable(false);
       t.setEditable(true);
       t.setEnabled(false);
       JFrame frame = new JFrame();
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       frame.getContentPane().add(t);
       frame.pack();
       frame.setVisible(true);
}

Similar Messages

  • Ask your question.how do you change the color of your tex bubbles.i accidently changed it from green to blue and I dont know how i did it

    how do I change the color of my tex bubbles? I changed one from green to blue accidently, and I cant figure out HOW I did it!

    I have a new iPhone 4 which has the latest version uploaded.  My daughter just bought an iPhone 4s and when we text it's still green.  We want it to be blue for iChat.  What are we doing wrong?  Why don't we have blue bubbles?  Any help would be greatly appreciated. 
    Thank you
    ~Tammi

  • How do I change the color of a calendar? It keeps changing back to the wrong color.

    I have tried to change the color of the calendar on iCloud, on the iPad, on the Mac desktop, and on the iPhone.  It will not change as per the instructions in the help guide.  It changes for about 1 second, then reverts back to a color I never chose.  How can I get it to accept my person preference?

    Please just have a look in the Support Communites and you will find multiple threads discussing the exact same issue. I would assume that it is a bug and Apple will solve this issue with an upcoming software update.

  • How can I change the color of subscribed calendar?

    Hello!
    I have subscribed two calendars from the internet at my ipad. They automatically got the colors green and red. Now I wanted to change these colors. So I did it and changed them in the calendar-app of the iPad to blue and yellow. At first it worked. But after a few minutes, the colors automatically changed back to green and red. And that happens all the time. Whenever I change the colors of my subscribed calendars, they automatically change back a few moments later.
    Why does it happen? And how can I make my iPad keep the new color settings?
    I am using iOS 5.0.1

    I figured out a solution for changing the other calendars but not the birthday calendar. Although it's not the most direct fix, it worked for me. Apparently Apple didn't think to give us the ability to choose the calendar color. I use Entourage and sync over the air. When I upgraded to iOS 4 my calendar turned bright red and the birthday calendar was blue. I don't use the birthday calendar so it isn't even enabled in my case. What finally worked was to go through the calendar colors one at a time by disabling and re-enabling the calendar in my mail account settings. I would double click the home button to quickly switch between settings and calendar to check the color each time I enabled the calendar. I had to do this 4 or 5 times to cycle through until blue came back up.

  • How to change the color of a DateSpinner in Flex

    Please how can i change the color of a DateSpinner in Flex Mobile?

    i have the following code here in the renderer n while setting the value in the table how do i pass the value n in the renderer i only have the indexes of the row n col how to check for the value thats not in the table i have commented the code where ever required... kindly help me out with this problem
    <Code>
    private JTable table = new JTable(){
         public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
              Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
              if (!isCellSelected(rowIndex, vColIndex)) {//What else should i put in here to check the value
                   c.setBackground(Color.yellow);
              else {
                   c.setBackground(getBackground());
              return c;
    StringBuffer sql = new StringBuffer("Select * from table)
    int row = 0;
    table.setRowCount(row);          
    try {
    ResultSet rs = //execute SQL
    while (rs.next()) {
         table.setRowCount(row + 1);
         table.setValueAt(rs.getString(1), row, 0);
         //This is where i have to change the color
         if(rs.getString("ColumnName").equals("Something")){
              //Change the color of the current row
         row++;
    rs.close();
    catch (SQLException e) {
    </Code>

  • How do I change the color of a subscribed read-only calendar?

    When I subscribe to Google's read-only "US Holidays" calendar using http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.c om/public/basic.ics my iPhone/iPad see the calendar just fine. However, it is light gray and I can't change the color. Is there a way to change the color of that subscribed calendar?
    Thanks,
    Mike

    Thanks Austin. I know of one place where you can, which is during the process of first subscribing to the shared calendar. The import dialog shows the calendar's color and you can change it at that point.
    I found this out only after posting my question, and it doesn't really provide a solution to my question; but your answer does seem to support my intial observation.

  • Can you edit the color of the bottom play bar on a slide once you assign the cpCmndShowPlaybar to 0

    Can you edit the color of the bottom play bar  on a slide once you assign the cpCmndShowPlaybar to 0. When I assign the slide this action it shows a grey shape at the bottom hiding the playbar controls, but I would like to make that color white to blend in with the white background on my webpage. How do you change the color?

    It is not possible to change the border color by an (advanced) action, sorry. If you do not mind, you could choose the white color for the bottom border from the start. When the playbar is showing, provided it it stretched, it will cover up this bottom border.
    Lilybiri

  • I am unable to change the color of text in an email I replay to or compose. I am on 31.6.0 release of Thunderbird.

    When I receive, reply or compose email. I no longer am able to see or change the color of text. I select to change the text from black to Red (or any other color) and the text just stays black, The color seletor box will show the last select color, but never actually changes the text color in an email. Also in received email, when the sender has indicated their replies to me are in another color, All the text only appears as black. I never had this problem in the past, not sure what has happened. I did restart Thunderbird with add-ons disabled and this did not change the problem.

    Hello, maybe the question need to move by a moderator to thunderbird support ?
    https://support.mozilla.org/en-US/questions/thunderbird?owner=all
    thank you
    [moderator note: question thread has been moved from Firefox queue to Thunderbird queue]

  • Can I change the color of a disabled JComboBox ?

    Hi !
    If I use setEnabled(false) the JComboBox has a grey Forground and a grey Background and I cannot use this for printing. I think it is not possible to change the colors of disabled boxes. I have not found a method and than I tried it with ListCellRenderer, but it dont work with disabled boxes. If I have an other possibility to lock the JComboBox and not use setEnabled(false) than I can change the color.
    Can I lock the JComboBox without using setEnabled(false)?
    OR can I change the color of disabled Boxes ?
    Please help me.
    Thank you Wolfgang

    Check the answer in java programming forum.

  • How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)

    Hello,
    Here is the problematic:
    1° How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)
    - I've many button in a doc im creating
    - the color of the buttons is white with black stoke & black text
    - in roll over state i want them to inverse the color coding (the text white & bottom black)
    - currently the text becomes invisible as black on black cant be seen (ive stroked it white but that looks ugly)
    - i would just like to know if there is a function made for this?
    My other questions:
    2° Ive a presentation on which Ive created buttons which tigger pop-up animations
    - i have 5 buttons which trigger animations
    - the viewer can chose to Click on any of the buttons randomly
    - the problem is once the animation is open how can it be close... either:
    a) by it self after "40" seconds
    b) when ther viewer clicks another button
    3° Ive created buttons linking pages..
    - "go to page xxx"
    - when i do a preview and click on the buttons the links dont take me to the right pages
    - is that normal? (maybe in preview its suppose to be like that)
    4° I would like to intergrate YouTube videos in the presentation so they play inside the docment.. when i tried.. it said the 'link isnt a flash video'
    - what should i do?
    5° Once i export it into Swf. how how can i visualize it? or put it online?
    Thank you for your time.

    stlbbl4u wrote:
    Hello,
    Here is the problematic:
    1° How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)
    - I've many button in a doc im creating
    - the color of the buttons is white with black stoke & black text
    - in roll over state i want them to inverse the color coding (the text white & bottom black)
    - currently the text becomes invisible as black on black cant be seen (ive stroked it white but that looks ugly)
    - i would just like to know if there is a function made for this?
    You should setup Object Styles - these can also include Paragarph Styles that can be triggered when the Style is selected.
    http://help.adobe.com/en_US/indesign/cs/using/WS5CEDB81A-0011-4dc9-9DE8-AC7AD4C80076a.html
    My other questions:
    2° Ive a presentation on which Ive created buttons which tigger pop-up animations
    - i have 5 buttons which trigger animations
    - the viewer can chose to Click on any of the buttons randomly
    - the problem is once the animation is open how can it be close... either:
    a) by it self after "40" seconds
    b) when ther viewer clicks another button
    I'm not sure what you mean - I don't do files with Animations
    3° Ive created buttons linking pages..- "go to page xxx"
    - when i do a preview and click on the buttons the links dont take me to the right pages
    - is that normal? (maybe in preview its suppose to be like that)
    Does it work properly when you export it to the finished file?
    4° I would like to intergrate YouTube videos in the presentation so they play inside the docment.. when i tried.. it said the 'link isnt a flash video'- what should i do?
    InDesign won't link directly to youtube videos. I think your best bet would be to use Downloader to download the video and embed them directly in Indesign.
    5° Once i export it into Swf. how how can i visualize it? or put it online? 
    Thank you for your time.
    You can look up how to embed a SWF file into your HTML - but it depends what you mean by "online" there's a dozen ways to get a file "online".

  • In working on a simple home budget,  how can I change the color of a negative number to red,  during the period the number is negative.    Thanks,

    Using Numbers spreadsheet and In working on a simple home budget,  how can I change the color of a number to RED when it  comes up negative.  (only during the time that it's negative)  Thanks,  ( I hope I did this right!!) 

    The Inspector offers choices of format for negative numbers when you choose Number of Currency as the format for a cell. Also offered when the format is set to Automatic, IF the selected cell(s) contain number(s).
    The choices are in the pop-up menu beside the box for number of decimal places.
    Regards,
    Barry

  • How can I change the color of plot in a waveform chart and graph?

    There are 4 plots in a waveform chart, from plot0 to plot3, and I want to chang the color of plots dynamicly up to my needs when the VI is running.
    For example, as show in the picture, i want to set the plot0 as RED, and plot1 is BLUE, plot2 is YELLOW, plot3 is GRAY.
    If there is only one plot, i can change it's color, however when there are more than one plot, it fail.
    How can I do it?
    Thanks
    Attachments:
    waveform.JPG ‏61 KB

    Hello MilkyStone,
    first you have to set the active plot, then change its color (or other properties). All that is done using property nodes.
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I always change the color of certain letters?

    I know that sounds weird. But hear me out.
    I was reading an article about synaesthesia, and it seems that reading with certain letters always displaying in a certain color can do interesting things.
    I'm not trying to do anything too crazy, just a little experiment on myself.
    So I'm wondering if anybody knows how I may change the color of certain letters on my Mac? I realize that'll make some interfaces look screwy, and in some instances it may not be possible - but is there a way?
    Thanks!

    Kliegs wrote:
    I've never heard of anything like this, so I'm just curious if it exists.
    You and me both, let's wait and see what other say.  My guess would be that modifications of that type aren't possible w/o some serious "modifications" i.e. hacks, if even via that method, specifically regarding the operating system.

  • How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text?

    How do I change the color of font in a fillable form in Adobe Reader? How can I check if the writer of the document has given permission to edit color and not just add text? Please help! I'm technologically challenged.

    Most forms (99% or more) are created for simple text input, where you cannot change anything.
    The creator of the form could allow Rich Text input (which allows you to change font, text size, color, etc.), but frankly I have never seen such a form, and I wouldn't know how they look.  But I'm sure they would show some kind of controls to alter the text appearance.

  • Can you change the color of a row in a SUD

    Is it possible to change the color in a selected row in a SUD? I have multiple tables in my SUD were the user can select multiple rows from each table. The problem is that when the user selects rows in another table the last one selected in the previous table is not hi-lighted. I thought that if I change the color of the row when selected the user can see all the selections once he/she goes to another table.
    Thanks,
    AJL

    Hi AJL,
    There is no way to color rows of the table control in a SUDialog. You could consider using the ActiveX container control and using the Microsoft ActiveX table control, which might have that functionality. Note though, that then you need to either ensure that control is always on all your client machines or make provisions for it to be installed/registered.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

Maybe you are looking for

  • Need to install ODBC driver 9.2.0.6.5 to client but how?

    Greetings. I have client PC (Not including DataBase engine) and I want install ODBC-driver version 9.2.0.6.5 (I have reasons). PC is normal Win XP 32bit. I found this driver from Oracle's download pages -> OK It's *.jar file, so I need to run it via

  • Second 27" iMac with dead pixels

    I'm intrigued to see how many others have purchased the new 27" iMac's and have managed to get one without any dead pixels. I am currently on my 2nd 27" iMac and both of them have a dead pixel right in the middle of the screen, first one was black, t

  • Contacts and calendar dont sync with outlook 2013 (win8) - working with IPhone 5S and Ipad air

    Dear all, i just moved to a new PC (former: Sony Vaio pro with win 7 pro, outlook 10 > new: sony vaio duo with win 8, outlook 13 from office 365 home). i used to sync outlook contacts and calendars with blackberry and iphone and ipad on my old notebo

  • 802.1x EAP-TLS with Cisco IP-Phone on MS NPS

    Hi, does anybody get 802.1x - EAP-TLS with IP-Phones ( e.g. 7962G ) on Microsoft NPS up and running? With ACS it is not a problem at all. thx Sebastian

  • Wcm_placeholder service pulls content with default template

    I have mutiple templates defined for a region definition in the placeholder definition. When accessing content using wcm_placeholder service it always pulls content usign the default template even if the content has been setup to use a different regi