Example usage for java.awt BorderLayout getLayoutComponent

List of usage examples for java.awt BorderLayout getLayoutComponent

Introduction

In this page you can find the example usage for java.awt BorderLayout getLayoutComponent.

Prototype

public Component getLayoutComponent(Object constraints) 

Source Link

Document

Gets the component that was added using the given constraint

Usage

From source file:Main.java

public Main() {

    JButton btn1 = new JButton("Button1");
    JButton btn2 = new JButton("Button2");
    JButton btn3 = new JButton("Button3");
    JButton btn4 = new JButton("Button4");
    JButton btn5 = new JButton("Button5");
    JButton btn6 = new JButton("Button6");

    BorderLayout borderLayout = new BorderLayout(20, 30);

    setLayout(borderLayout);/*from w  w w  .  ja v  a 2 s .  c  om*/

    add("North", btn1);
    add("West", btn2);
    add("Center", btn3);
    add("Center", btn4);
    add("South", btn5);
    add("East", btn6);

    System.out.println(borderLayout.getLayoutComponent(BorderLayout.NORTH));
}

From source file:org.kuali.test.ui.components.panels.HtmlCheckpointPanel.java

private CheckpointProperty getTableCheckpointProperty(int indx) {
    CheckpointProperty retval = null;//from   w  w  w  .jav  a 2  s .c o  m
    TablePanel tp = null;

    if (tabbedPane != null) {
        tp = (TablePanel) tabbedPane.getSelectedComponent();
    } else {
        BorderLayout layout = (BorderLayout) getLayout();
        tp = (TablePanel) layout.getLayoutComponent(BorderLayout.CENTER);
    }

    if (tp != null) {
        retval = (CheckpointProperty) tp.getTable().getModel().getData().get(indx);
    }

    return retval;
}