?? line.java
字號:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package screenpen;import java.awt.Color;import java.awt.Graphics;import java.util.logging.Level;import java.util.logging.Logger;/** * * @author zhaolin */public class Line implements Cloneable{ private Color color = Color.RED; private int x1,y1,x2,y2; public Color getColor() { return color; } public void setColor(Color color) { this.color = color; } public int getX1() { return x1; } public void setX1(int x1) { this.x1 = x1; } public int getX2() { return x2; } public void setX2(int x2) { this.x2 = x2; } public int getY1() { return y1; } public void setY1(int y1) { this.y1 = y1; } public int getY2() { return y2; } public void setY2(int y2) { this.y2 = y2; } public void paintMySelf(Graphics g){ g.setColor(color); g.drawLine(x1, y1, x2, y2); } public Object clone(){ try { return super.clone(); } catch (CloneNotSupportedException ex) { Logger.getLogger(Line.class.getName()).log(Level.SEVERE, null, ex); return null; } } }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -