[J2ME] JLabel圖片更新破碎
請問一下
我想在一個 JLabel上面更新一張圖
圖片是動態從網站去抓的
但是每次更新之後
新的圖片和舊的圖片疊在一起之後
我是用 JSlider去控制圖片的大小
畫面就會破碎 而且多試幾次之後
error msg就會出現 java.lang.OutOfMemoryError: Java heap space
我的程式碼主要有問題的片段:
JSlider source = (JSlider)e.getSource(); // get the slider
zoom = source.getValue();
map = new Map((byte)zoom,scale,scale,center);
MapServe.GetMap(GISService.GetMap,map);
gmaplabel = new JLabel(new ImageIcon(map.getJpgimage()));
mainlabel.add(gmaplabel);
mainlabel.updateUI();
有沒有辦法可以平滑的更新圖片呢?
煩請知道的人回應一下 感激不盡~~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.76.249.10
推
11/18 23:22, , 1F
11/18 23:22, 1F