日期:2014-05-20 浏览次数:20828 次
import javax.swing.*;
import java.awt.*;
public class linke extends JFrame{
int xx=0;
int yy=0;
String a="";
public linke()
{
this.setAlwaysOnTop(true);
this.getContentPane().setBackground(Color.BLACK);
this.setUndecorated(true);
this.setSize(476,156);
this.setLocation(50,50);
this.setVisible(true);
}
public void paint(Graphics g){
super.paint(g);
xx=0;
yy=0;
g.setColor(Color.WHITE);
for(int c=1;c<32;c++){ //控制行的输出
xx=0;
for(int i=1;i<97;i++){ //控制列的输出
if(i%6 == 0 && i!=0){
g.setColor(Color.BLACK);
}else{
g.setColor(Color.WHITE);
}
if(c%8==0){
g.setColor(Color.BLACK);
}
g.fill3DRect(xx, yy, 5, 5, true);
xx=xx+5;
}
yy=yy+5;
}
}
public static void main(String args[]){
linke l = new linke();
l.setBackground(Color.RED);
}
}