954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem displaying icon on JLabel inside a JTree nodes

I am facing a strange problem, and seriously I spend lot of time in experimenting different things to get it work but all in vain.

I have a JTree whose nodes are been modified by my custom TreeCellRenderer class. My class creates a JPanel for every node and places components over that panel and assign various values to them and then the node is created. I have a JLabel on it whose purpose is to display avatar of users fetched from the google talk server.

Now the problem is that, the avatar icons get displayed on the jlabel when I put them on it as they are without any modification(without scaling) but when I try to scale the avatar using the getScaledInstanceMethod of Image class then nothing appears on the Jlabel when I run my program.

for checking if there is any memory issue or they are not getting scaled properly etc. so for that I planted a loop that creates a new JFrame and places a label over it and which display that scaled avatar. Then to my surprise when I executed that program, then the scaled avatar started appearing on the Jtree nodes as well along with the JFrames.

I modified tested my code to every extent, but can't figure out what is the issue with them. Any ideas?

warlord902
Junior Poster
120 posts since Dec 2010
Reputation Points: 19
Solved Threads: 0
 

anybody knows?????

warlord902
Junior Poster
120 posts since Dec 2010
Reputation Points: 19
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: