首页 > 其他 > 详细

信息界面

时间:2018-06-06 00:45:42      阅读:238      评论:0      收藏:0      [点我收藏+]
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Myself extends Frame
{
JButton Exit;
public Myself()
{
super("myself");
setSize(250,300);
this.setLocation(300, 240);
this.setBackground(Color.green);
this.setLayout(new FlowLayout());
this.add(new Label("name"));
this.add(new TextField("一朵",25));
this.add(new Label("Stud_Number"));
this.add(new TextField("19903311098",25));
this.add(new Label("sex"));
this.add(new TextField("woman",25));
this.add(new Label("political status"));
this.add(new TextField("Legue member",25));
Exit=new JButton("EXIT");
this.add(Exit);
this.addWindowListener(new WinClose());
this.setVisible(true);
}
public static void main(String[] args) {
new Myself(); //实例化
}
}
class WinClose implements WindowListener
{
public void windowClosing(WindowEvent ev)
{
ev.getWindow().dispose();
} //关闭窗口方法
public void windowOpened(WindowEvent ev) {}
public void windowClosed(WindowEvent ev) {}

public void windowIconified(WindowEvent ev) {}

public void windowDeiconified(WindowEvent ev) {}

public void windowActivated(WindowEvent ev) {}

public void windowDeactivated(WindowEvent ev) {}

}
 
 

信息界面

原文:https://www.cnblogs.com/404607yiduo/p/9142436.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!