本文整理汇总了Java中javax.swing.LayoutStyle.ComponentPlacement方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutStyle.ComponentPlacement方法的具体用法?Java LayoutStyle.ComponentPlacement怎么用?Java LayoutStyle.ComponentPlacement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.LayoutStyle
的用法示例。
在下文中一共展示了LayoutStyle.ComponentPlacement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeVerticalStrut
import javax.swing.LayoutStyle; //导入方法依赖的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);
}
示例2: makeHorizontalStrut
import javax.swing.LayoutStyle; //导入方法依赖的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);
}
示例3: getSpace
import javax.swing.LayoutStyle; //导入方法依赖的package包/类
private int getSpace(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related, int horizontal) {
return LayoutStyle.getInstance()
.getPreferredGap(compA,
compB,
related,
(horizontal == HORIZONTAL) ? EAST : SOUTH,
parent);
}
示例4: createHorizontalStrut
import javax.swing.LayoutStyle; //导入方法依赖的package包/类
private Component createHorizontalStrut(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related) {
return Box.createHorizontalStrut(getSpace(parent, compA, compB, related, HORIZONTAL));
}
示例5: createVerticalStrut
import javax.swing.LayoutStyle; //导入方法依赖的package包/类
private Component createVerticalStrut(JComponent parent, JComponent compA, JComponent compB, LayoutStyle.ComponentPlacement related) {
return Box.createVerticalStrut(getSpace(parent, compA, compB, related, VERTICAL));
}