• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Render imageicon in Jtable (I need optimize!)

 
jordi uve
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jordi, welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/java-2d/60725-render-imageicon-jtable-i-need-optimize.html
 
jordi uve
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ouch! You catch me! Sorry.. you know but an answer to my post(s)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic