本文整理匯總了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;
}