当前位置: 首页>>代码示例>>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;未经允许,请勿转载。