doublemetal 2013. 7. 17. 00:46


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();

}

}