本文整理匯總了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);
}