作者TonyQ (骨头)
看板java
标题Re: [问题] CloseableFrame框架下绘图问题
时间Tue Apr 10 18:49:23 2007
※ 引述《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