Solved

Change JComboBox foreground color when disabled

Posted on 2006-06-15
11
1,041 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
Technology Partners: 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 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example 17 59
ejb wildfly example 2 74
Java syntax, or is it Selenium 6 41
dao vs facade design patterns 2 34
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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

733 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