aspose file tools
The moose likes Java in General and the fly likes How can i change the Color of Images on JComponent Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

How can i change the Color of Images on JComponent

Bhagya Tangutur
Ranch Hand

Joined: Oct 21, 2002
Posts: 88
How do i change the color of Image on my JComponent.I placing an Image on JComponent through setIcon() method and passing ImageICon object.How can i change the color of the image which i passed to this Image Object.Or please sussest me any better way of doiing it.
I will be knowing the colors only at runTime.
here is my code which will explain easy to understand...
Say ...
JLabel label=new JLabel("My text");
ImageIcon icon=new IMageIcon("myImage.gif");
label.setIcon(icon);
now how can i change the color of this image in runtime.


Sun Certified Java Programmer
Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
hey.. let us know your true name before the teacher punishes you !
Leena


[SCJP2, SCWCD1.3, SCBCD]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Howdy hiThere for u r answers,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Note that you don't have to use your true name, just one that follows the naming policy.
Thanks Pardner! Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Please do not cross post. Continue the conversation here.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How can i change the Color of Images on JComponent
 
Similar Threads
Images on top of each other
Cannot add an image to JPanel. Nothing works:(
how to change the ImageIcon of a JLabel?
How can i change the Color of Images on JComponent
GridBagLaout