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


Java Box.createHorizontalStrut方法代碼示例

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


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

示例1: makeHorizontalStrut

import javax.swing.Box; //導入方法依賴的package包/類
static Component makeHorizontalStrut(JComponent compA,
                                          JComponent compB,
                                          ComponentPlacement relatedUnrelated,
                                          JPanel parent) {
        int width = LayoutStyle.getInstance().getPreferredGap(
                            compA,
                            compB,
                            relatedUnrelated,
                            WEST,
                            parent);
        return Box.createHorizontalStrut(width);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:VCSCommitPanel.java

示例2: makeHorizontalStrut

import javax.swing.Box; //導入方法依賴的package包/類
private Component makeHorizontalStrut(JComponent compA,
                                      JComponent compB,
                                      LayoutStyle.ComponentPlacement relatedUnrelated) {
    int width = LayoutStyle.getInstance().getPreferredGap(
                        compA,
                        compB,
                        relatedUnrelated,
                        WEST,
                        this);
    return Box.createHorizontalStrut(width);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:CommitPanel.java

示例3: defaultHeight

import javax.swing.Box; //導入方法依賴的package包/類
private static int defaultHeight() {
    if (DEFAULT_HEIGHT == -1) {
        JPanel ref = new JPanel(null);
        ref.setLayout(new BoxLayout(ref, BoxLayout.LINE_AXIS));
        ref.setOpaque(false);
        
        ref.add(new JLabel("XXX")); // NOI18N
        
        ref.add(new JButton("XXX")); // NOI18N
        ref.add(new PopupButton("XXX")); // NOI18N
        
        ref.add(new JCheckBox("XXX")); // NOI18N
        ref.add(new JRadioButton("XXX")); // NOI18N
        
        ref.add(new JTextField("XXX")); // NOI18N
        
        ref.add(new JExtendedSpinner(new SpinnerNumberModel(1, 1, 655535, 1)));
        
        Component separator = Box.createHorizontalStrut(1);
        Dimension d = separator.getMaximumSize(); d.height = 20;
        separator.setMaximumSize(d);
        ref.add(separator);
        
        DEFAULT_HEIGHT = ref.getPreferredSize().height;
    }
    return DEFAULT_HEIGHT;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:SettingsPanel.java

示例4: createStrut

import javax.swing.Box; //導入方法依賴的package包/類
private static Component createStrut(JComponent c, int width, boolean before) {
    Border b = c.getBorder();
    Insets i = b != null ? b.getBorderInsets(c) : null;
    int w = i == null ? width : Math.max(width - (before ? i.left : i.right), 0);
    return Box.createHorizontalStrut(w);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:ObjectsFeatureModes.java

示例5: createHorizontalStrut

import javax.swing.Box; //導入方法依賴的package包/類
private Component createHorizontalStrut(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related) {
    return Box.createHorizontalStrut(getSpace(parent, compA, compB, related, HORIZONTAL));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:RepositorySelectorBuilder.java

示例6: initializePanels

import javax.swing.Box; //導入方法依賴的package包/類
private void initializePanels(){
	
	/* PANELFIRST INITIALIZATION */
	
	this.panelFirst = new JPanel();
	this.panelFirst.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
	
	GridBagConstraints gbc_panel = new GridBagConstraints();
	gbc_panel.fill = GridBagConstraints.BOTH;
	gbc_panel.insets = new Insets(0, 0, 5, 0);
	gbc_panel.gridx = 0;
	gbc_panel.gridy = 0;
	
	this.contentPane.add(this.panelFirst, gbc_panel);
	
	GridBagLayout gbl_panel = new GridBagLayout();
	gbl_panel.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0};
	gbl_panel.rowHeights = new int[]{0, 0, 0, 0};
	gbl_panel.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
	gbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
	
	this.panelFirst.setLayout(gbl_panel);
	
	Component verticalStrut_1 = Box.createVerticalStrut(20);
	GridBagConstraints gbc_verticalStrut_1 = new GridBagConstraints();
	gbc_verticalStrut_1.insets = new Insets(0, 0, 5, 5);
	gbc_verticalStrut_1.gridx = 5;
	gbc_verticalStrut_1.gridy = 0;
	
	this.panelFirst.add(verticalStrut_1, gbc_verticalStrut_1);
	
	Component horizontalStrut = Box.createHorizontalStrut(20);
	GridBagConstraints gbc_horizontalStrut = new GridBagConstraints();
	gbc_horizontalStrut.insets = new Insets(0, 0, 5, 5);
	gbc_horizontalStrut.gridx = 0;
	gbc_horizontalStrut.gridy = 1;
	
	this.panelFirst.add(horizontalStrut, gbc_horizontalStrut);
	
	/* END PANELFIRST INITIALIZATION */
	
	/* PANELSECOND INITIALIZATION */
	
	this.panelSecond = new JPanel();
	this.panelSecond.setSize(282, 300);
	
	GridBagConstraints gbc_panel_1 = new GridBagConstraints();
	gbc_panel_1.anchor = GridBagConstraints.NORTH;
	gbc_panel_1.fill = GridBagConstraints.HORIZONTAL;
	gbc_panel_1.gridx = 0;
	gbc_panel_1.gridy = 1;
	
	this.contentPane.add(this.panelSecond, gbc_panel_1);
	
	GridBagLayout gbl_panel_1 = new GridBagLayout();
	gbl_panel_1.columnWidths = new int[]{60, 77, 0};
	gbl_panel_1.rowHeights = new int[]{36, 0, 0, 0, 0, 0, 0, 0, 15, 0};
	gbl_panel_1.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
	gbl_panel_1.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
	
	this.panelSecond.setLayout(gbl_panel_1);
	
	Component verticalStrut = Box.createVerticalStrut(20);
	GridBagConstraints gbc_verticalStrut = new GridBagConstraints();
	gbc_verticalStrut.insets = new Insets(0, 0, 5, 0);
	gbc_verticalStrut.gridx = 1;
	gbc_verticalStrut.gridy = 3;
	
	this.panelSecond.add(verticalStrut, gbc_verticalStrut);
	
	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 = 1;
	gbc_verticalStrut_2.gridy = 4;
	
	this.panelSecond.add(verticalStrut_2, gbc_verticalStrut_2);
	
	/* END PANELSECOND INITIALIZATION */
}
 
開發者ID:cjlcarvalho,項目名稱:LogisticApp,代碼行數:81,代碼來源:CadastroFrame.java

示例7: 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


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