gui组件
时间:2014-04-29 16:48:47
收藏:0
阅读:313
//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);
}
}
评论(0)