?? 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 + -