Solved

Change JComboBox foreground color when disabled

Posted on 2006-06-15
11
1,045 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 25 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 92

Assisted Solution

by:objects
objects earned 25 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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:

691 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