本文整理汇总了Java中javax.swing.Box.createHorizontalGlue方法的典型用法代码示例。如果您正苦于以下问题:Java Box.createHorizontalGlue方法的具体用法?Java Box.createHorizontalGlue怎么用?Java Box.createHorizontalGlue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.Box
的用法示例。
在下文中一共展示了Box.createHorizontalGlue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeComponents
import javax.swing.Box; //导入方法依赖的package包/类
private void initializeComponents() {
Component horizontalGlue = Box.createHorizontalGlue();
GridBagConstraints gbc_horizontalGlue = new GridBagConstraints();
gbc_horizontalGlue.insets = new Insets(0, 0, 5, 5);
gbc_horizontalGlue.gridx = 0;
gbc_horizontalGlue.gridy = 0;
this.panelSecond.add(horizontalGlue, gbc_horizontalGlue);
Component horizontalGlue_2 = Box.createHorizontalGlue();
GridBagConstraints gbc_horizontalGlue_2 = new GridBagConstraints();
gbc_horizontalGlue_2.insets = new Insets(0, 0, 5, 5);
gbc_horizontalGlue_2.gridx = 2;
gbc_horizontalGlue_2.gridy = 0;
this.panelSecond.add(horizontalGlue_2, gbc_horizontalGlue_2);
Component horizontalGlue_3 = Box.createHorizontalGlue();
GridBagConstraints gbc_horizontalGlue_3 = new GridBagConstraints();
gbc_horizontalGlue_3.insets = new Insets(0, 0, 5, 5);
gbc_horizontalGlue_3.gridx = 4;
gbc_horizontalGlue_3.gridy = 0;
this.panelSecond.add(horizontalGlue_3, gbc_horizontalGlue_3);
Component horizontalGlue_1 = Box.createHorizontalGlue();
GridBagConstraints gbc_horizontalGlue_1 = new GridBagConstraints();
gbc_horizontalGlue_1.insets = new Insets(0, 0, 5, 0);
gbc_horizontalGlue_1.gridx = 6;
gbc_horizontalGlue_1.gridy = 0;
this.panelSecond.add(horizontalGlue_1, gbc_horizontalGlue_1);
Component verticalStrut = Box.createVerticalStrut(20);
GridBagConstraints gbc_verticalStrut = new GridBagConstraints();
gbc_verticalStrut.fill = GridBagConstraints.VERTICAL;
gbc_verticalStrut.gridx = 0;
gbc_verticalStrut.gridy = 2;
this.panel.add(verticalStrut, gbc_verticalStrut);
}