哥們兒, 怎麼取得鼠標的位置 增加鼠标事件,如鼠标压下等地那个 解决方案 » 免费领取超大流量手机卡,每月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()+")"); } } bat运行java? java 控制热敏打印机打印图像 java中怎么将域名解析为ip 求一算法 兄弟们进来看看...愁死我了 JTree展开问题 请教一个FileInputStream的问题 SQL语句问题.(在线等待) orcale数据库连接问题 问一个很弱的问题,error open regedit:soft\.... 哪位大牛帮忙看一下这个继承问题 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()+")");
}
}