Solved

Change JComboBox foreground color when disabled

Posted on 2006-06-15
11
1,025 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
  • 4
  • 2
  • 2
  • +1
11 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 25 total points
Comment Utility
Try

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

Author Comment

by:mattjulius
Comment Utility
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
Comment Utility
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
 
LVL 92

Assisted Solution

by:objects
objects earned 25 total points
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:mattjulius
Comment Utility
What do you mean OBJECTS???
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
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
Comment Utility
hey mayankeagle ,

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

Author Comment

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

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now