?? right.java
字號:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Right extends JFrame {
public Right(){
JButton b1=new JButton("sleep");
JButton b2=new JButton("Hello");
b1.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
try{
Thread.currentThread().sleep(5000);
}catch(Exception e){}
}
}
);
b2.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
System.out.println("hello world");
}
}
);
getContentPane().setLayout(new FlowLayout());
getContentPane().add(b1);
getContentPane().add(b2);
pack();
show();
}
public static void main(String[] args)
{
new Right();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -