总结:
package com.ds;
import java.awt.Color;
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JButton;
public class gfrd{
static JFrame j=new JFrame("欢迎来到我的新浪微博");
static JButton b=new JButton("登陆");
static JButton b2=new JButton("注册");
static JButton b3=new JButton("重置");
static JButton b4=new JButton("修改");
static JButton b5=new JButton("设置");
public static void main(String[] args) {
j.setBackground(Color.blue);
j.setLayout(new FlowLayout());//所有按钮均可显示
j.add(b);
j.add(b2);
j.add(b3);
j.add(b4);
j.add(b5);
j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
j.setBounds(643, 567, 745, 645);
j.setLocationRelativeTo(null);//使窗体居中 显示在屏幕上
j.setVisible(true);
}
}