?? linecomponent.java
字號(hào):
package com.vimas.interfaceapplet;
import java.awt.*;
public class LineComponent extends Component
{
Color c;//it's color
int direction;//VERICAL<=>HORISONTAl
int length;//length
public static final int VERTICAL=1;
public static final int HORIZONTAL=2;
public LineComponent(int direction, int length, Color c)
{
super();
this.c=c;
this.direction=direction;
this.length=length;
}
public void paint(Graphics g)
{
g.setColor(c);
int x2=0,y2=0;
if(direction==1) y2=length; else x2=length;
g.drawLine(0,0,x2,y2);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -