gui组件


//guI; graphics user interface
import javax.swing.*;
import java.awt.*;

public class Main {

public static void main(String[] args) {
JFrame f = new JFrame();
f.setTitle("main");
//f.setSize(300,400);
f.setBounds(20,30,300,400);
f.setVisible(true);
Container c=f.getContentPane();
c.setLayout(new FlowLayout());
JLabel lab=new JLabel();
lab.setSize(20,300);
lab.setText("第一个:");
lab.setBackground(new Color(200,0,0));
lab.setFont(new Font("黑体",Font.BOLD,35));
//lab.setVisible(false);
c.add(lab);






}
}

posted @ 2014-04-29 16:55  Liping的个人博客  阅读(213)  评论(0编辑  收藏  举报