當前位置: 首頁>>代碼示例>>Java>>正文


Java Box.createRigidArea方法代碼示例

本文整理匯總了Java中javax.swing.Box.createRigidArea方法的典型用法代碼示例。如果您正苦於以下問題:Java Box.createRigidArea方法的具體用法?Java Box.createRigidArea怎麽用?Java Box.createRigidArea使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.Box的用法示例。


在下文中一共展示了Box.createRigidArea方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initializeAreas

import javax.swing.Box; //導入方法依賴的package包/類
private void initializeAreas() {
	Component verticalStrut_2 = Box.createVerticalStrut(20);
	GridBagConstraints gbc_verticalStrut_2 = new GridBagConstraints();
	gbc_verticalStrut_2.insets = new Insets(0, 0, 5, 0);
	gbc_verticalStrut_2.gridx = 10;
	gbc_verticalStrut_2.gridy = 0;
	this.panelFirst.add(verticalStrut_2, gbc_verticalStrut_2);

	Component rigidArea_9 = Box.createRigidArea(new Dimension(20, 20));
	GridBagConstraints gbc_rigidArea_9 = new GridBagConstraints();
	gbc_rigidArea_9.insets = new Insets(0, 0, 5, 5);
	gbc_rigidArea_9.gridx = 0;
	gbc_rigidArea_9.gridy = 1;
	this.panelFirst.add(rigidArea_9, gbc_rigidArea_9);

	Component horizontalStrut_3 = Box.createHorizontalStrut(20);
	GridBagConstraints gbc_horizontalStrut_3 = new GridBagConstraints();
	gbc_horizontalStrut_3.insets = new Insets(0, 0, 5, 5);
	gbc_horizontalStrut_3.gridx = 7;
	gbc_horizontalStrut_3.gridy = 1;
	this.panelFirst.add(horizontalStrut_3, gbc_horizontalStrut_3);

	Component rigidArea_10 = Box.createRigidArea(new Dimension(20, 20));
	GridBagConstraints gbc_rigidArea_10 = new GridBagConstraints();
	gbc_rigidArea_10.insets = new Insets(0, 0, 5, 5);
	gbc_rigidArea_10.gridx = 9;
	gbc_rigidArea_10.gridy = 1;
	this.panelFirst.add(rigidArea_10, gbc_rigidArea_10);

	Component verticalStrut_5 = Box.createVerticalStrut(20);
	GridBagConstraints gbc_verticalStrut_5 = new GridBagConstraints();
	gbc_verticalStrut_5.insets = new Insets(0, 0, 5, 5);
	gbc_verticalStrut_5.gridx = 8;
	gbc_verticalStrut_5.gridy = 2;
	this.panelFirst.add(verticalStrut_5, gbc_verticalStrut_5);

	Component horizontalStrut_2 = Box.createHorizontalStrut(20);
	GridBagConstraints gbc_horizontalStrut_2 = new GridBagConstraints();
	gbc_horizontalStrut_2.insets = new Insets(0, 0, 0, 5);
	gbc_horizontalStrut_2.gridx = 5;
	gbc_horizontalStrut_2.gridy = 3;
	this.panelFirst.add(horizontalStrut_2, gbc_horizontalStrut_2);

	Component rigidArea_4 = Box.createRigidArea(new Dimension(20, 20));
	GridBagConstraints gbc_rigidArea_4 = new GridBagConstraints();
	gbc_rigidArea_4.insets = new Insets(0, 0, 5, 5);
	gbc_rigidArea_4.gridx = 2;
	gbc_rigidArea_4.gridy = 1;
	this.panelSecond.add(rigidArea_4, gbc_rigidArea_4);

	Component rigidArea_7 = Box.createRigidArea(new Dimension(20, 20));
	GridBagConstraints gbc_rigidArea_7 = new GridBagConstraints();
	gbc_rigidArea_7.insets = new Insets(0, 0, 5, 5);
	gbc_rigidArea_7.gridx = 3;
	gbc_rigidArea_7.gridy = 2;
	this.panelSecond.add(rigidArea_7, gbc_rigidArea_7);

	Component horizontalStrut_4 = Box.createHorizontalStrut(20);
	GridBagConstraints gbc_horizontalStrut_4 = new GridBagConstraints();
	gbc_horizontalStrut_4.insets = new Insets(0, 0, 5, 0);
	gbc_horizontalStrut_4.gridx = 8;
	gbc_horizontalStrut_4.gridy = 2;
	this.panelSecond.add(horizontalStrut_4, gbc_horizontalStrut_4);

	Component rigidArea_5 = Box.createRigidArea(new Dimension(20, 20));
	GridBagConstraints gbc_rigidArea_5 = new GridBagConstraints();
	gbc_rigidArea_5.insets = new Insets(0, 0, 5, 5);
	gbc_rigidArea_5.gridx = 2;
	gbc_rigidArea_5.gridy = 3;
	this.panelSecond.add(rigidArea_5, gbc_rigidArea_5);

	Component rigidArea_3 = Box.createRigidArea(new Dimension(20, 20));
	GridBagConstraints gbc_rigidArea_3 = new GridBagConstraints();
	gbc_rigidArea_3.insets = new Insets(0, 0, 0, 5);
	gbc_rigidArea_3.gridx = 0;
	gbc_rigidArea_3.gridy = 5;
	this.panelSecond.add(rigidArea_3, gbc_rigidArea_3);
}
 
開發者ID:cjlcarvalho,項目名稱:LogisticApp,代碼行數:79,代碼來源:LocalidadeFrame.java

示例2: createPaddingComponent

import javax.swing.Box; //導入方法依賴的package包/類
/**
 * Creates a padding component.
 *
 * @param horizontalPadding determines whether we are interested in horizontal padding.
 * @param verticalPadding determines whether we are interested in vertical padding.
 * @param paddingSize determines padding component size in pixels.
 * @return new padding component.
 */
private static Component createPaddingComponent(boolean horizontalPadding, boolean verticalPadding, int paddingSize) {
    Dimension dim = new Dimension(horizontalPadding ? paddingSize : 0, verticalPadding ? paddingSize : 0);
    JComponent padding = (JComponent)Box.createRigidArea(dim);
    padding.putClientProperty(PADDING_COMPONENT, Boolean.TRUE);
    return padding;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:GridUtils.java


注:本文中的javax.swing.Box.createRigidArea方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。