📄 lotsofcircles.java
字号:
import java.awt.*;
public class LotsOfCircles
extends Canvas
{
public void paint(Graphics g)
{
/* as before but without super.paintComponent(g); */
for (int i = 0; i < 10000; i++)
{
Color color = new Color( (int) (255 * Math.random()),
(int) (255 * Math.random()),
(int) (255 * Math.random()));
int x = (int) (getSize().width * Math.random());
int y = (int) (getSize().height * Math.random());
g.setColor(color);
g.fillOval(x - 10, y - 10, 20, 20);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -