📄 myversionbean.java
字号:
package Communication;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class myVersionBean extends JFrame
{
JLabel name=new JLabel("微型通讯录系统2.1 欢迎使用!");
JLabel author=new JLabel("made by 刘常昱");
JButton ok=new JButton("确定");
public myVersionBean()
{
this.setTitle("微型通讯录");
this.setSize(250,140);
this.setLocation((1024-getWidth())/2,(760-getHeight())/2);
this.setVisible(true);
init();
}
public void init()
{
JPanel p1=new JPanel();
p1.add(name,"Center");
this.getContentPane().add(p1,"North");
JPanel p2=new JPanel();
p2.add(author,"Center");
this.getContentPane().add(p2,"Center");
JPanel p3=new JPanel();
p3.add(ok,"center");
this.getContentPane().add(p3,"South");
ok.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
dispose();
}
});
}
public static void main(String args[])
{
myVersionBean m=new myVersionBean();
m.show();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -