example7_11.java

来自「不错的教程 适合中高级人员的使用」· Java 代码 · 共 40 行

JAVA
40
字号
import java.awt.*;
import java.awt.event.*;
import java.util.*;


	   
	class WindowTen extends Frame implements ActionListener
	{
     Panel p;ScrollPane scrollpane;
	 WindowTen()
	{
	 setLayout(new FlowLayout());
	 p=new Panel();
	 scrollpane=new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
	 p.add(new Button("one"));
	 p.add(new Button("two"));
	 p.add(new Button("three"));
	 p.add(new Button("four"));
	 scrollpane.add(p);
	 add(scrollpane);	
	 setBounds(60,60,200,200);
	 setVisible(true);
	 validate();
	}
	
	public void actionPerformed(ActionEvent e)
	{
		System.exit(0);
	}

}

public class Example7_11
{
	public static void main(String[] args) 
	{
		new WindowTen();
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?