📄 rebound.java
字号:
//********************************************************************
// Rebound.java Author: Lewis/Loftus
//
// Demonstrates an animation and the use of the Timer class.
//********************************************************************
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Rebound extends JApplet
{
private final int DELAY = 20;
private Timer timer;
//-----------------------------------------------------------------
// Sets up the applet, including the timer for the animation.
//-----------------------------------------------------------------
public void init()
{
timer = new Timer (DELAY, null);
getContentPane().add (new ReboundPanel(timer));
}
//-----------------------------------------------------------------
// Starts the animation when the applet is started.
//-----------------------------------------------------------------
public void start ()
{
timer.start();
}
//-----------------------------------------------------------------
// Stops the animation when the applet is stopped.
//-----------------------------------------------------------------
public void stop ()
{
timer.stop();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -