码迷,mamicode.com
首页 > 其他好文 > 详细

信息界面

时间:2018-06-06 01:12:25      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:xtend   window   event   stc   opened   class   实例   关闭   his   

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) {}

}
 
 

信息界面

标签:xtend   window   event   stc   opened   class   实例   关闭   his   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!