- 讲师:刘萍萍 / 谢楠
- 课时:160h
- 价格 4580 元
特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关
配套通关班送国网在线题库一套
百度广告
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.Timer;
public class Main {
JDialog dialog;
Point naturalLocation;
Timer shakeTimer;
public Main(JDialog d) {
dialog = d;
}
public void startShake() {
final long startTime;
naturalLocation = dialog.getLocation();
startTime = System.currentTimeMillis();
shakeTimer = new Timer(5, new ActionListener() {
public void actionPerformed(ActionEvent e) {
double TWO_PI = Math.PI * 2.0;
double SHAKE_CYCLE = 50;
long elapsed = System.currentTimeMillis() - startTime;
double waveOffset = (elapsed % SHAKE_CYCLE) / SHAKE_CYCLE;
double angle = waveOffset * TWO_PI;
责编:罗莉
上一篇:Java信号量模型实际应用手册
下一篇:Java中的输入/输出(I/O)
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
点击加载更多评论>>