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

📄 boxlayoutframe.java.bak

📁 java2的应用软件
💻 BAK
字号:
import java.awt.*;
import javax.swing.*;
public class BoxLayoutFrame extends JFrame
{
BoxLayoutTest panel=new BoxLayoutTest();
public BoxLayoutFrame()
{
this.getContentPane().add(panel);
this.setSize(500,220);
this.setTitle("BoxLayoutDemo");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.show();
}
public static void main(String[] args)
{
BoxLayoutFrame frame=new BoxLayoutFrame();
}
}
class BoxLayoutTest extends JPanel
{
BoxLayoutTest()
{
setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
TextField textfield=new TextField();
TextArea textArea=new TextArea(4,20);
JButton button=new JButton("Click Me!");
add(new JLabel("TextField"));
add(textField);
add(new JLabel("TextArea"));
add(textArea);
add(new JLabel("Button"));
add(button);
}
}

⌨️ 快捷键说明

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