?? attgraph.java
字號:
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
/*
* Created on 06/04/2005
*/
/**
* @author Fernando Meyer
*/
class AttGraph extends Canvas {
/**
*
*/
private static final long serialVersionUID = 1L;
public AttGraph(){
}
// This method is called whenever the contents needs to be painted
public void paint(Graphics g) {
// Retrieve the graphics context; this object is used to paint shapes
Graphics2D g2d = (Graphics2D)g;
int width = getSize().width-1;
int height = getSize().height-1;
int x = 0;
int y = 0;
g.setClip(x,y,width+1,height+1);
g2d.setPaint(Color.white);
g2d.fill(new Rectangle2D.Double(x, y,
width, height));
//g2d.setColor(Color.white);
// Draw an oval that fills the window
g2d.setPaint(Color.black);
//g2d.drawOval(x, y, width, height);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -