窗口类:
public class Index_JFrame extends JFrame{
private String title = "学生管理系统1.0";
private final int width = 600;
private final int height = 700;
Container container;
// private Component component;
{
//设置窗口标题
this.setTitle(title);
//定位窗口
this.setBounds(400,200,width,height);
this.setLayout(null);
//获取Component对象,
this.container = this.getContentPane();
//设置标签
JLabel userName = new JLabel("用户名");
userName.setBounds(80,80,10,20);
JLabel password = new JLabel("密码");
password.setBounds(80,100,10,20);
JLabel Verification_code = new JLabel("验证码");
Verification_code.setBounds(80,120,10,20);
//添加组件
this.container.add(userName);
this.container.add(password);
this.container.add(Verification_code);
//设置可见性
this.setVisible(true);
//设置是否可调整窗口大小
this.setResizable(false);
//设置窗口关闭监听事件
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
在启动类中创建窗口类对象后,运行发生这样的事情
不知道这个点点是乱码还是怎么回事