Java Code Examples for java.awt.BorderLayout.EAST

The following are Jave code examples for showing how to use EAST of the java.awt.BorderLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Logisim   File: Frame.java   View Source Code Vote up 5 votes
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();
}
 
Example 2
Project: incubator-netbeans   File: DialogSupport.java   View Source Code Vote up 4 votes
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;
}
 
Example 3
Project: ramus   File: ElementAttributesEditor.java   View Source Code Vote up 4 votes
@Override
public String getDefaultPosition() {
    return BorderLayout.EAST;
}
 
Example 4
Project: ramus   File: AttributeEditorView.java   View Source Code Vote up 4 votes
@Override
public String getDefaultPosition() {
    return BorderLayout.EAST;
}
 
Example 5
Project: ramus   File: JSModulesEditor.java   View Source Code Vote up 4 votes
@Override
public String getDefaultPosition() {
    return BorderLayout.EAST;
}