[J2ME] JLabel圖片更新破碎

看板java作者 (批踢踢大gg)時間16年前 (2009/11/18 16:22), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
請問一下 我想在一個 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
文章代碼(AID): #1B0wxP3D (java)