本文整理汇总了Java中javax.swing.Box.createVerticalStrut方法的典型用法代码示例。如果您正苦于以下问题:Java Box.createVerticalStrut方法的具体用法?Java Box.createVerticalStrut怎么用?Java Box.createVerticalStrut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.Box
的用法示例。
在下文中一共展示了Box.createVerticalStrut方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateContents
import javax.swing.Box; //导入方法依赖的package包/类
public void updateContents(final boolean remove) {
// for more background on this issue, see AquaMenuBorder.getBorderInsets()
isPopDown = isPopdown();
if (isPopDown) {
if (remove) {
if (topStrut != null) {
this.remove(topStrut);
}
if (bottomStrut != null) {
this.remove(bottomStrut);
}
} else {
add(scroller);
}
} else {
if (topStrut == null) {
topStrut = Box.createVerticalStrut(4);
bottomStrut = Box.createVerticalStrut(4);
}
if (remove) remove(scroller);
this.add(topStrut);
this.add(scroller);
this.add(bottomStrut);
}
}
示例2: makeVerticalStrut
import javax.swing.Box; //导入方法依赖的package包/类
private Component makeVerticalStrut(JComponent compA,
JComponent compB,
LayoutStyle.ComponentPlacement relatedUnrelated) {
int height = LayoutStyle.getInstance().getPreferredGap(
compA,
compB,
relatedUnrelated,
SOUTH,
this);
return Box.createVerticalStrut(height);
}
示例3: makeVerticalStrut
import javax.swing.Box; //导入方法依赖的package包/类
private static Component makeVerticalStrut(JComponent compA,
JComponent compB) {
LayoutStyle layoutStyle = LayoutStyle.getInstance();
return Box.createVerticalStrut(
layoutStyle.getPreferredGap(compA,
compB,
UNRELATED,
SOUTH,
compA.getParent()));
}
示例4: makeVerticalStrut
import javax.swing.Box; //导入方法依赖的package包/类
static Component makeVerticalStrut(JComponent compA,
JComponent compB,
ComponentPlacement relatedUnrelated,
JPanel parent) {
int height = LayoutStyle.getInstance().getPreferredGap(
compA,
compB,
relatedUnrelated,
SOUTH,
parent);
return Box.createVerticalStrut(height);
}
示例5: 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);
}
示例6: createVerticalStrut
import javax.swing.Box; //导入方法依赖的package包/类
private Component createVerticalStrut(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related) {
return Box.createVerticalStrut(getSpace(parent, compA, compB, related, VERTICAL));
}
示例7: 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 */
}
示例8: 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);
}