作者qrtt1 (thinking in java)
看板java
标题[讨论] 滑鼠一起按@@"
时间Wed Jan 18 19:19:19 2006
我提供了一个鸟方法XD
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
public class F extends JFrame {
public long p_time = 0;
public int limit = 90;
public F() {
this.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
System.out.println(e + "\t");
long get_time = System.currentTimeMillis();
if (get_time - p_time < limit)
System.out.println("2 button click at the same time");
p_time = get_time;
}
});
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setSize(40, 40);
this.setVisible(true);
}
public static void main(String[] args) {
new F();
}
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.26.34.20