Re: [問題] CloseableFrame框架下繪圖問題

看板java作者 (骨頭)時間18年前 (2007/04/10 18:49), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《tobechihiro (飛べ! 私の理想へ!)》之銘言: : 在該pane裡頭分4塊區域 : 然後能讓使用者選擇一張圖片放在4個區域中的中之一(有定座標) : 要怎樣作才能使用者選位置呢? EventListener < java.awt.event.MouseListener public void mouseClicked(MouseEvent e) 點擊滑鼠 public void mouseEntered(MouseEvent e) 進入聆聽的區塊 public void mouseExited(MouseEvent e) 離開聆聽的區塊 public void mousePressed(MouseEvent e) 壓下滑鼠 public void mouseReleased(MouseEvent e) 放開滑鼠 < < javax.swing.event.MouseInputListener 除上繼承述MouseListener的mehtod外 另外繼承 MouseMotionListener public void mouseDragged(MouseEvent e) 拖曳滑鼠 public void mouseMoved(MouseEvent e) 移動滑鼠 ----使用的時候--------前提是this implement MouseInputListener---- Panel.addMouseListener(this); 功用:可以聆聽到MouseListener的事件 ( click ,press ,release, enter, exit) Panel.addMouseMotionListener(this); 同上 ( drag ,move) -- 你的問題太簡單了,這是以前做的筆記 或許你用的上 -- I am a person, and I am always thinking . Thinking in love , Thinking in life , Thinking in why , Thinking in worth. I can't believe any of what , I am just thinking then thinking , but worst of all , most of mine is thinking not actioning... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68
文章代碼(AID): #166sksVP (java)
文章代碼(AID): #166sksVP (java)