티스토리 뷰
import java.awt.Color;
import java.awt.Frame;
import java.awt.Label;
import java.awt.Panel;
class LabelTest extends Frame{
Panel p;
Label label1, label2, label3;
public LabelTest(){
setTitle("Label Test");
p = new Panel();
label1 = new Label("개신동");
label2 = new Label("모충동");
label3 = new Label("수곡동");
label1.setBackground(Color.yellow);
label2.setBackground(Color.BLUE);
label3.setBackground(Color.blue);
//Blue와 blue의 차이??
//The color blue. In the default sRGB space.
//Blue은 1.4 이후에 정의된 상수인듯??
p.add(label1);
p.add(label2);
p.add(label3);
add(p);
setSize(300,100);
setVisible(true);
}
}
public class LabelMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
LabelTest lt = new LabelTest();
}
}
'java,web study > 3주차 (7월 15일 ~21일)' 카테고리의 다른 글
리스트 컴포넌트 (0) | 2013.07.17 |
---|---|
깜박이는 레이블 (0) | 2013.07.17 |
제네릭 (0) | 2013.07.16 |
빠른 열거 (0) | 2013.07.16 |
String Format (0) | 2013.07.16 |