📄 shiyan6_3.java
字号:
import java.applet.Applet;
import java.awt.*;
public class Shiyan6_3 extends Applet
{
public int i;
int x[]={60,65,70,75,80,85,90,85,80,75,70,65,60};
public void init()
{
resize(140,60);
i=0;
}
public void paint(Graphics g)
{
Color a=new Color(255,175,175);
Color b=new Color(192,192,192);
Color c=new Color(0,0,255);
g.setColor(c);
g.fillRect(0,0,140,60);
g.setColor(a);
g.fillRect(60,0,60,50);
g.setColor(b);
g.fillOval(x[i],0,30,30);
i++;
if(i==13) i=0;
try
{
Thread.sleep(800);
}
catch (InterruptedException e)
{
}
repaint();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -