當前位置: 首頁>>代碼示例>>Java>>正文


Java JComponent.setAlignmentY方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:38,代碼來源:EmptyTestStepLocation.java

示例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;
}
 
開發者ID:HML-UnBBayes,項目名稱:hml,代碼行數:10,代碼來源:MyPanel.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:46,代碼來源:TestSuiteStepLocation.java


注:本文中的javax.swing.JComponent.setAlignmentY方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。