• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

包com。海尔。第01课;

导入Java。awt。*;

导入Java。awt。事件。窗口适配器;

导入Java。awt。事件。窗口事件;

//面板可以看成是一个空间,但是不能单独存在

公共类测试面板{

公共静态void main(String[] args) {

框架Frame=new Frame();

Panel Panel=new Panel();//布局的概念

//设置布局

panel.setLayout(空);

//坐标

frame.setBounds(300,300,500,500);

frame.setBackground(新颜色(97,220,103));

//panle设置坐标,相对于设计

panel.setBounds(50,50,40,40);

panel.setBackground(新颜色(212,63,63));

框架。添加(面板);

框架。设置可见(真);

//监听时事件,监听窗口关闭事件,System.exit()

//适配器模式

框架。addwindowlistener(新窗口适配器(){

//窗口点击关闭的时候需要做的事情

@覆盖

公共void窗口关闭(窗口事件e){

//结束程序

系统。退出(0);

}

});

}

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now