📄 driver.java
字号:
import javax.swing.JFrame;import java.awt.Color;/** PolkaDot Program * Author: David Riley * Date: January, 2005 */public class Driver { private JFrame window; public Driver() { int yCount, xCount; Oval dot; Color rowColor; window = new JFrame("Polkadot by column"); window.setBounds(10, 10, 200, 200); window.setVisible(true); window.setLayout(null); xCount = 0; while ( xCount != 8 ) { rowColor = new Color(xCount/9.0f, xCount/9.0f, xCount/9.0f); yCount = 0; while ( yCount !=12) { dot = new Oval(xCount*25, yCount*15, 10, 10); dot.setBackground(rowColor); window.add(dot, 0); yCount++; } xCount++; } window.repaint(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -