[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to Color Elements in the JComboBox

Posted on 2001-07-05
4
Medium Priority
?
387 Views
Last Modified: 2008-02-01
Dear Friends


How do i color different elements in the JComboBox.
I want that when i select an element in the JComboBox it is highlighted with different color but not with the deafult color. i want different colors for different elemts in the combobox.



Thanxs in advance

Bye
prasad
0
Comment
Question by:sdinfosys
[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
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 120 total points
ID: 6258332
prasad,

You need to define your own ListCellRender using the setRenderer method.
Your renderer probably just needs to extend DefaultListCellRenderer adding the enhancements you require.
0
 

Author Comment

by:sdinfosys
ID: 6258396
Objects

Thanxs Objects for your instant reply.
i will try that and get u know.

bye objects
Prasad
0
 
LVL 92

Expert Comment

by:objects
ID: 6258399
No worries, let me know if you have any problems :)
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 8975012


No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


-- points to objects


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 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