哥們兒, 怎麼取得鼠標的位置 增加鼠标事件,如鼠标压下等地那个 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.awt.*;import java.awt.event.*;public class Example18_6 extends Applet implements MouseMotionListener{ TextField text; public void init() { text=new TextField(); setLayout(new BorderLayout()); setBackground(Color.green); addMouseMotionListener(this); add(text,"South"); } public void mouseDragged(MouseEvent e) {text.setBackground(Color.red); text.setText("鼠标的坐标:"+"("+e.getX()+","+e.getY()+")"); } public void mouseMoved(MouseEvent e) {text.setBackground(Color.blue); text.setText("鼠标的坐标:"+"("+e.getX()+","+e.getY()+")"); } } Win8快捷键与Eclipse冲突 急求复数与map的笔试题啊 java中怎么启动本机exe软件 加载数据源的时候不对,求解 synchronized标记 和synchronized 方法有什么区别 问个菜问题 jdk1.5上Calendar的使用是否与jdk1.4的不同? 为什么4个相同的iframe只有两个显示内容? [大家都近来看看]一个新手可能都会遇到的问题,请各位老手和新手提出宝贵建议! Jbuilder4相关注册码(先答后问) JBuilder快捷键大搜集,来者有分 scj的310-025和sl-275考试有什么不一样?
import java.awt.event.*;
public class Example18_6 extends Applet implements MouseMotionListener
{ TextField text;
public void init()
{ text=new TextField();
setLayout(new BorderLayout());
setBackground(Color.green);
addMouseMotionListener(this); add(text,"South");
}
public void mouseDragged(MouseEvent e)
{text.setBackground(Color.red);
text.setText("鼠标的坐标:"+"("+e.getX()+","+e.getY()+")");
}
public void mouseMoved(MouseEvent e)
{text.setBackground(Color.blue);
text.setText("鼠标的坐标:"+"("+e.getX()+","+e.getY()+")");
}
}