?? app18_11.java
字號:
// app18_11, 剪裁繪圖區
import java.awt.*;
class app18_11 extends Frame
{
static app18_11 frm=new app18_11();
public static void main(String args[])
{
frm.setTitle("setClip()"); // 限定繪圖的顯示區域
frm.setSize(200,150);
frm.setVisible(true);
}
public void paint(Graphics g)
{
g.setClip(35,37,125,95);
for(int x=10;x<=180;x=x+20)
for(int y=27;y<=140;y=y+20)
{
int red=(int)(Math.random()*255);
int green=(int)(Math.random()*255);
int blue=(int)(Math.random()*255);
g.setColor(new Color(red,green,blue));
g.fillOval(x,y,15,15);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -