jpanelboxtest.java

来自「java编程开发技巧与实例的编译测试通过的所有例程」· Java 代码 · 共 29 行

JAVA
29
字号
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.*;

public class JPanelBoxTest extends JFrame
{
	private JButton titleButton	=	new JButton("Button with a Title");
	private JButton quit		=	new JButton("Quit");
	private JButton test		=	new JButton("Test");
	
	public JPanelBoxTest()
	{
		super("JPanelBox Test");
		JPanelBox buttons	=	new JPanelBox(new FlowLayout(), "Action");
		buttons.add(quit);
		buttons.add(test);
		getContentPane().setLayout(new GridLayout(2, 1));
		getContentPane().add(new JPanelBox(titleButton, "A Title"));
		getContentPane().add(buttons);
		validate();
		pack();
		setVisible(true);
	}
	public static void main(String args[])
	{
		JPanelBoxTest jpbt	=	new JPanelBoxTest();
	}
}

⌨️ 快捷键说明

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