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

📄 hboxwithglue.java

📁 java swing 开发代码
💻 JAVA
字号:
// HBoxWithGlue.java// A quick test of the box layout manager using the Box utility class.//package	jswing.ch11;import java.awt.*;import javax.swing.*;public class HBoxWithGlue extends JFrame {  public HBoxWithGlue() {    super("Box & Glue Frame");    setSize(350, 100);    Box box = Box.createHorizontalBox();    setContentPane(box);    box.add(Box.createHorizontalGlue());    for (int i = 0; i < 3; i++) {      Button b = new Button("B" + i);      box.add(b);    }    box.add(Box.createHorizontalGlue());    setDefaultCloseOperation(EXIT_ON_CLOSE);    setVisible(true);  }  public static void main(String args[]) {    HBoxWithGlue bt = new HBoxWithGlue();  }}

⌨️ 快捷键说明

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