当前位置: 首页>>代码示例>>Java>>正文


Java BorderLayout.SOUTH属性代码示例

本文整理汇总了Java中java.awt.BorderLayout.SOUTH属性的典型用法代码示例。如果您正苦于以下问题:Java BorderLayout.SOUTH属性的具体用法?Java BorderLayout.SOUTH怎么用?Java BorderLayout.SOUTH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.BorderLayout的用法示例。


在下文中一共展示了BorderLayout.SOUTH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: placeToolbar

private void placeToolbar() {
	String loc = AppPreferences.TOOLBAR_PLACEMENT.get();
	Container contents = getContentPane();
	contents.remove(toolbar);
	mainPanelSuper.remove(toolbar);
	if (AppPreferences.TOOLBAR_HIDDEN.equals(loc)) {
		; // don't place value anywhere
	} else if (AppPreferences.TOOLBAR_DOWN_MIDDLE.equals(loc)) {
		toolbar.setOrientation(Toolbar.VERTICAL);
		mainPanelSuper.add(toolbar, BorderLayout.WEST);
	} else { // it is a BorderLayout constant
		Object value = BorderLayout.NORTH;
		for (Direction dir : Direction.cardinals) {
			if (dir.toString().equals(loc)) {
				if (dir == Direction.EAST)
					value = BorderLayout.EAST;
				else if (dir == Direction.SOUTH)
					value = BorderLayout.SOUTH;
				else if (dir == Direction.WEST)
					value = BorderLayout.WEST;
				else
					value = BorderLayout.NORTH;
			}
		}

		contents.add(toolbar, value);
		boolean vertical = value == BorderLayout.WEST || value == BorderLayout.EAST;
		toolbar.setOrientation(vertical ? Toolbar.VERTICAL : Toolbar.HORIZONTAL);
	}
	contents.validate();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:31,代码来源:Frame.java

示例2: createDialog

public Dialog createDialog( String title, JPanel panel, boolean modal,
        JButton[] buttons, boolean sidebuttons, int defaultIndex,
        int cancelIndex, ActionListener listener ) {

    // create the dialog with given content
    JDialog d = new JDialog( (javax.swing.JFrame)null, title, modal );
    d.setDefaultCloseOperation( WindowConstants.DO_NOTHING_ON_CLOSE );
    d.getContentPane().add( panel, BorderLayout.CENTER);
    
    // Add the buttons to it
    JPanel buttonPanel = createButtonPanel( buttons, sidebuttons );
    String buttonAlign = sidebuttons ? BorderLayout.EAST : BorderLayout.SOUTH;
    d.getContentPane().add( buttonPanel, buttonAlign );

    // add listener to buttons
    if( listener != null ) {
        for( int i = 0; i < buttons.length; i++ ) {
            buttons[i].addActionListener( listener );
        }
    }

    // register the default button, if available
    if( defaultIndex >= 0 ) {
        d.getRootPane().setDefaultButton( buttons[defaultIndex] );
    }
    
    // register the cancel button helpers, if available
    if( cancelIndex >= 0 ) {
        cancelButton = buttons[cancelIndex];
        // redirect the Esc key to Cancel button
        d.getRootPane().registerKeyboardAction(
            this,
            KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, true),
            JComponent.WHEN_IN_FOCUSED_WINDOW
        );

        // listen on windowClosing and redirect it to Cancel button
        d.addWindowListener( this );
    }

    d.pack();
    return d;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:DialogSupport.java

示例3: getDefaultPosition

@Override
public String getDefaultPosition() {
    return BorderLayout.SOUTH;
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:4,代码来源:ReportAttributesView.java


注:本文中的java.awt.BorderLayout.SOUTH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。