aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Render imageicon in Jtable (I need optimize!) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Render imageicon in Jtable (I need optimize!) " Watch "Render imageicon in Jtable (I need optimize!) " New topic
Author

Render imageicon in Jtable (I need optimize!)

jordi uve
Greenhorn

Joined: Jun 16, 2012
Posts: 2
Hello people! my name is Jordi, from Barcelona.

I am working in a java project. I've one Jtable where the first column is a jlabel with an imageicon inside. The idea is that the user select from his computer photos and when he click Add, the images are added to the jtable. This works fine but I've the windows task monitor opened and I see the ram memory grows A LOT. From 50mb to 400mb adding 10photos of 3mb every one. I don't know how can I optimize that. I know that the jtable is rendering every time, so I have created a customized "cache" --> HashMap<String,ImageIcon> cache; Then in the getValueAt (of my Jtable's model) I've this:



What more can I do to optimize the heap and memory? thanks!!!

Jordi

pd: the scale function I think it's not the problem, is fast, the quality is not important because the thumbnail is so small ( http://www.copypastecode.com/241178 )
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

jordi, welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/java-2d/60725-render-imageicon-jtable-i-need-optimize.html


luck, db
There are no new questions, but there may be new answers.
jordi uve
Greenhorn

Joined: Jun 16, 2012
Posts: 2
Ouch! You catch me! Sorry.. you know but an answer to my post(s)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Render imageicon in Jtable (I need optimize!)