Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change JComboBox foreground color when disabled

Posted on 2006-06-15
11
Medium Priority
?
1,061 Views
Last Modified: 2012-06-27
Hi

I want to ask how can I change the foreground color of JComboBox when disabled because UIManager.put doesnt work for me????
0
Comment
Question by:mattjulius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
11 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 16918009
Try

put("ComboBox.disabledForeground", Color.gray);
0
 

Author Comment

by:mattjulius
ID: 16918232
I already tried it once and it works but most of the time it doesnt. Is there any way to do it properly
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16918240
It's a once and for all operation - not sure why 'sometimes' comes into it. It's meant to be done at the entry point of your program
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 16918433
It depends on what L&F you are using. What L&F did you want it to work for?

> I already tried it once and it works but most of the time it doesnt.

Make sure you do it *right at the begining of your app, *before* you create your gui.
0
 

Author Comment

by:mattjulius
ID: 16918677
What do you mean OBJECTS???
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16920063
Before you call setVisible () to your JFrame (or whatever top level window you have), call UIManager.put () - better to call it right at the start of the program.
0
 

Author Comment

by:mattjulius
ID: 16924590
hey mayankeagle ,

Have you try it?? because its not working for me and Im using JInternalFrame...
0
 

Author Comment

by:mattjulius
ID: 16924595
Is there any other way to change the foreground of the JComboBox when disable??
0
 
LVL 92

Expert Comment

by:objects
ID: 16925915
OIt depends on what L&F you are using, how it is displayed is L&F dependenet.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question