- 浏览: 136586 次
- 性别:
- 来自: 洛阳
文章分类
- 全部博客 (158)
- Java基础 (19)
- JavaEE (6)
- Other (17)
- DataBase (7)
- Ajax (2)
- JavaScript (6)
- 转载 (3)
- 疑惑 (6)
- 计算机二级 (0)
- [网站分类]1.网站首页原创Java技术区(对首页文章的要求: 原创、高质量、经过认真思考并精心写作。BlogJava管理团队会对首页的文章进行管理。) (6)
- [网站分类]4.其他技术区 (19)
- [网站分类]2.Java新手区 (29)
- Linux操作系统 (1)
- java基础与算法 (7)
- [网站分类]6.转载区(Java技术文章转载, 请注明原文出处) (1)
- [网站分类]3.非技术区 (4)
- [网站分类]5.提问区(Java方面的技术提问) (6)
最新评论
-
azhqiang:
直接把鼠标放到虚拟机和本地电脑的两个状态栏中间就会显示菜单了。 ...
VirtualBox无缝模式如何退出 -
axiob:
这个太赞了,支持一下
MySQL乱码实战解决ERROR 1366 (HY000): Incorrect string value: ' -
404714:
:arrow:
Mouse Can't Click——鼠标点不住代码 -
didasoft:
还有邀请吗?能否给我发一个?didasoft@gmail.co ...
Google Wave -
avast:
哥们 给我一个 wave邀请 谢谢aplieo@gmail.c ...
Google Wave
/**/
/*
* mainf.java
*
* Created on 2009-3-22, 10:16:38
*/
/** */ /**
*
* @author ChengLu
*/
public class mainf extends javax.swing.JFrame {
/** */ /** Creates new form mainf */
public mainf() {
initComponents();
}
/** */ /** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings( " unchecked " )
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout( new java.awt.GridBagLayout());
jLabel1.setText( " 我做的好不好? " );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
getContentPane().add(jLabel1, gridBagConstraints);
jLabel2.setText( " Email: chenglu@yeah.net Web:http://www.mobai.org " );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0 ;
gridBagConstraints.gridy = 3 ;
gridBagConstraints.gridheight = 8 ;
getContentPane().add(jLabel2, gridBagConstraints);
jButton2.setText( " 很好 " );
jButton2.addMouseListener( new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
}
} );
jButton2.addActionListener( new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
} );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0 ;
gridBagConstraints.gridy = 1 ;
getContentPane().add(jButton2, gridBagConstraints);
jButton1.setText( " 不好 " );
jButton1.addMouseListener( new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButton1MouseEntered(evt);
}
} );
jButton1.addActionListener( new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
} );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0 ;
gridBagConstraints.gridy = 2 ;
getContentPane().add(jButton1, gridBagConstraints);
pack();
} // </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton1MouseEntered(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
jButton1.setLocation(locatx(),locaty());
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
jButton2.setText( " 我就知道你最终会点这个的哈 " );
}
public static int locatx() {
return ( int )(Math.random() * 666 );
}
public static int locaty() {
return ( int )(Math.random() * 666 );
}
/** */ /**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater( new Runnable() {
public void run() {
new mainf().setVisible( true );
}
} );
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
// End of variables declaration
}
* mainf.java
*
* Created on 2009-3-22, 10:16:38
*/
/** */ /**
*
* @author ChengLu
*/
public class mainf extends javax.swing.JFrame {
/** */ /** Creates new form mainf */
public mainf() {
initComponents();
}
/** */ /** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings( " unchecked " )
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout( new java.awt.GridBagLayout());
jLabel1.setText( " 我做的好不好? " );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
getContentPane().add(jLabel1, gridBagConstraints);
jLabel2.setText( " Email: chenglu@yeah.net Web:http://www.mobai.org " );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0 ;
gridBagConstraints.gridy = 3 ;
gridBagConstraints.gridheight = 8 ;
getContentPane().add(jLabel2, gridBagConstraints);
jButton2.setText( " 很好 " );
jButton2.addMouseListener( new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
}
} );
jButton2.addActionListener( new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
} );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0 ;
gridBagConstraints.gridy = 1 ;
getContentPane().add(jButton2, gridBagConstraints);
jButton1.setText( " 不好 " );
jButton1.addMouseListener( new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButton1MouseEntered(evt);
}
} );
jButton1.addActionListener( new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
} );
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0 ;
gridBagConstraints.gridy = 2 ;
getContentPane().add(jButton1, gridBagConstraints);
pack();
} // </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton1MouseEntered(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
jButton1.setLocation(locatx(),locaty());
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
jButton2.setText( " 我就知道你最终会点这个的哈 " );
}
public static int locatx() {
return ( int )(Math.random() * 666 );
}
public static int locaty() {
return ( int )(Math.random() * 666 );
}
/** */ /**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater( new Runnable() {
public void run() {
new mainf().setVisible( true );
}
} );
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
// End of variables declaration
}
没技术含量,由NetBeans直接生成,嘿嘿
思路:
创建一个Jbutton,设置鼠标Entered事件,如果事件发生,那么Jbutton.setLocation(x,y);即更改位置
x,y值是2个随机数
那么就是Math.random();生成一个随机数(0-1之间的double数),乘以666强制转换(int)之后传入Jbutton.setLocation(x,y);即可。
(Done)
发表评论
-
HelloWorld
2008-08-27 18:44 5231 public cla ... -
JAVA语言的数据类型如何划分
2008-09-27 16:39 592Java语言提供了八种基本类型。六种数字类型(四个整数型,两个 ... -
reverse()实例
2008-10-25 18:33 6101import java.util.*; 2class ... -
JSP---request方法
2009-02-26 14:31 5951<form name = "form1& ... -
JSP-response练习 (小学校小课堂小练习)
2009-03-03 11:30 782first: index.html 1<!DOCTYP ... -
jsp-session
2009-03-05 15:47 698session从第一个页面传到第二个 看代码: 1< ... -
JavaBean初探
2009-03-16 20:10 590Student.java 1package bean; 2 ... -
Tomcat临时目录——解决缓存的问题
2009-03-17 12:33 1580X:\\*(TomCat安装目录)\work\Catalina ... -
Java File创建文件夹
2009-03-30 09:37 741import java.io.*;public class ... -
MySQL乱码实战解决ERROR 1366 (HY000): Incorrect string value: '
2009-04-17 03:13 987ERROR 1366 (HY000): Incorrect s ... -
一个低级错误~
2009-05-09 10:22 588<script language="javas ... -
腾讯年度创新大赛试题!
2009-05-09 14:31 615Problem A: University Time Limi ... -
SQLException: No suitable driver for XXX解决方案(NetBeans)
2009-05-26 13:37 752今日研究NetBeans欲完成课程设计学生管理系统, 突然发现 ... -
课程设计——学生管理系统
2009-06-08 08:58 743项目做完了,有一个很大设计模式的bug,但已经不想再改了,马上 ... -
学生管理系统 源代码
2009-06-08 09:13 853http://www.blogjava.net/chenglu ... -
一些刚发现的网址
2009-07-20 13:52 325http://www.oracle.com/technolog ... -
计算机二级
2009-09-12 21:34 7361)栈和队列的共同特点是 C A)都是先进先出 B)都是先进后 ... -
struts标签
2009-09-16 07:58 756A: <s:a xhref="&q ... -
一个不会报错的jsp彩色验证码程序
2009-09-22 14:52 731一个不会报错的jsp彩色验证码程序 一般的,会报servlet ... -
低调的apache fileUpload应用
2009-09-23 12:08 731Apache FileUpload可以应用于很多方面 现将一应 ...
相关推荐
MouseClick MouseClick MouseClick MouseClick MouseClick MouseClick
MouseClick是一款可以用键盘代替鼠标按键的软件,它能帮助你自动进行点击鼠标左键、右键以及双击操作,需要的朋友快来下载使用吧。
magic mouse驱动是官方为苹果无线鼠标提供的硬件驱动程序,安装成功该驱动之后,用户就可以将鼠标与电脑相连接,进行一系列的点击操作,magic mouse驱动并且兼容xp、win7等多种操作系统,拥有这款鼠标的用户赶快试试...
鼠标自动点击源代码vb mouse 鼠标点击速度可以调节,鼠标左键右键也可以选择。 2009 新增自定义热键,新增单击双击可以选
dos下的鼠标程序——mouse.com
苹果Magic Mouse鼠标在Mac平台下,有着极其良好的表现,但是其与Windows电脑连接后,却仅可使用鼠标左右按键,而无法进行滚轮滚动操作,这对于Windows用户来说是完全无法容忍的。 如何在Windows电脑上使用Magic ...
在C#的WebBrowse控件中捕获 MouseClick 或 MouseDown事件的方法。
一个DELPHI写的可重复鼠标点击屏幕上任意一点的小工具,可以自定义重复次数、鼠标点击坐标、间隔时间,附源码。
GX-Mouse是一个小巧的工具,如果有用Protel 99 SE来绘图的朋友,由于Protel 99 SE不支持鼠标的上下滚动,当你打开Protel 99 SE,就打开这个程序,支持鼠标上下滚动,方便操作,内部有详细说明!
鼠标移动工具MoveMouse,完美解决锁屏问题。
内含程序源码,程序主要功能:输入循环的次数,每次点击的间隔时间,需要模拟点击的位置,主要使用mouse_event鼠标点击事件设计的。
曼巴蛇鼠标驱动XM-M398 GAMING MOUSE V1.0
使用ch375和stc 51写的usb鼠标的代码
用C#写的,github上我也放了源代码,放到vs里面生成就可以,repo/bin里面好像有生成好的exe程序,他的功能就是可以设定一个时间间隔,然后来点击屏幕。这个是第二版,可能被我改成了按ctrl,将源代码中的注释去掉...
超好用的一款鼠标连点器
2、源代码中的U_Mouse.C文件实现了数据通讯的协议,Chap_9.C含有鼠标枚举所需的各种描述符。 3、上述文件实为USB接口芯片D12开发的经典参考资料及制作USB鼠标的极佳参考原型。 4、阅读源程序前务必先阅读开发评估板...
detect mouse vc 探测鼠标 窗口程序 detect mouse vc 探测鼠标 窗口程序
鼠标点击事件,在X15 应用层模拟鼠标移动 点击事件
telink 2.4G无线鼠标参考代码,工程较为完整,供参考。 one device for three dongle.
USB MOUSE USB鼠标