⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 right.java

📁 java 数据结构的一些简单实例和一些线程的应用主要是面向初学者
💻 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 + -