本文整理汇总了Java中javax.swing.JComponent.setAlignmentY方法的典型用法代码示例。如果您正苦于以下问题:Java JComponent.setAlignmentY方法的具体用法?Java JComponent.setAlignmentY怎么用?Java JComponent.setAlignmentY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.setAlignmentY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createVisualComp
import javax.swing.JComponent; //导入方法依赖的package包/类
private Component createVisualComp() {
JCheckBox[] chkBoxes;
JComponent optCode = GuiUtils.createChkBoxGroup(
NbBundle.getMessage(
GuiUtils.class,
"CommonTestsCfgOfCreate.groupOptCode"), //NOI18N
chkBoxes = GuiUtils.createCheckBoxes(new String[] {
GuiUtils.CHK_SETUP,
GuiUtils.CHK_TEARDOWN,
GuiUtils.CHK_BEFORE_CLASS,
GuiUtils.CHK_AFTER_CLASS}));
chkSetUp = chkBoxes[0];
chkTearDown = chkBoxes[1];
chkBeforeClass = chkBoxes[2];
chkAfterClass = chkBoxes[3];
JComponent optComments = GuiUtils.createChkBoxGroup(
NbBundle.getMessage(
GuiUtils.class,
"CommonTestsCfgOfCreate.groupOptComments"), //NOI18N
chkBoxes = GuiUtils.createCheckBoxes(new String[] {
GuiUtils.CHK_HINTS}));
chkCodeHints = chkBoxes[0];
JComponent box = new SelfResizingPanel();
box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS));
box.add(optCode);
box.add(Box.createHorizontalStrut(18));
box.add(optComments);
/* tune layout of the components within the box: */
optCode.setAlignmentY(0.0f);
optComments.setAlignmentY(0.0f);
return box;
}
示例2: createPaneH
import javax.swing.JComponent; //导入方法依赖的package包/类
public JPanel createPaneH(JComponent pane1, JComponent pane2 ) {
JPanel pane = new JPanel();
pane.setLayout(new BoxLayout(pane, BoxLayout.X_AXIS));
pane1.setAlignmentY(Component.LEFT_ALIGNMENT);
pane2.setAlignmentY(Component.LEFT_ALIGNMENT);
pane.add(pane1);
pane.add(pane2);
return pane;
}
示例3: createVisualComp
import javax.swing.JComponent; //导入方法依赖的package包/类
private Component createVisualComp() {
JCheckBox[] chkBoxes;
JComponent infoLabel = GuiUtils.createMultilineLabel(
NbBundle.getMessage(TestSuiteStepLocation.class,
"TXT_ClassesInSuite")); //NOI18N
JComponent optCode = GuiUtils.createChkBoxGroup(
NbBundle.getMessage(
GuiUtils.class,
"CommonTestsCfgOfCreate.groupOptCode"), //NOI18N
chkBoxes = GuiUtils.createCheckBoxes(new String[] {
GuiUtils.CHK_SETUP,
GuiUtils.CHK_TEARDOWN,
GuiUtils.CHK_BEFORE_CLASS,
GuiUtils.CHK_AFTER_CLASS}));
chkSetUp = chkBoxes[0];
chkTearDown = chkBoxes[1];
chkBeforeClass = chkBoxes[2];
chkAfterClass = chkBoxes[3];
JComponent optComments = GuiUtils.createChkBoxGroup(
NbBundle.getMessage(
GuiUtils.class,
"CommonTestsCfgOfCreate.groupOptComments"), //NOI18N
chkBoxes = GuiUtils.createCheckBoxes(new String[] {
GuiUtils.CHK_HINTS}));
chkCodeHints = chkBoxes[0];
JComponent bottomPanel = new SelfResizingPanel();
bottomPanel.setLayout(new BorderLayout(0, 24));
bottomPanel.add(infoLabel, BorderLayout.NORTH);
JComponent box = new JPanel();
box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS));
box.add(optCode);
box.add(Box.createHorizontalStrut(18));
box.add(optComments);
bottomPanel.add(box, BorderLayout.CENTER);
/* tune layout of the components within the box: */
infoLabel.setAlignmentX(0.0f);
optCode.setAlignmentY(0.0f);
optComments.setAlignmentY(0.0f);
return bottomPanel;
}