Forums Register Login

Render imageicon in Jtable (I need optimize!)

+Pie Number of slices to send: Send
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 )
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Ouch! You catch me! Sorry.. you know but an answer to my post(s)
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1428 times.
Similar Threads
JTable Updating
JTable
Adding images in JTable
Rotating an imageicon in JTable cells
Thumbnail inside JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:24:30.