File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 4522
    
    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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Render imageicon in Jtable (I need optimize!)
 
Similar Threads
Rotating an imageicon in JTable cells
JTable
JTable Updating
Thumbnail inside JTable
Adding images in JTable