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






}
}

你可能感兴趣的:(GUI)