Java JComponent Container allignBottom(JComponent lead, JComponent target)

Here you can find the source of allignBottom(JComponent lead, JComponent target)

Description

allign Bottom

License

LGPL

Declaration

public static void allignBottom(JComponent lead, JComponent target) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.awt.Rectangle;
import javax.swing.JComponent;

public class Main {
    public static void allignBottom(JComponent lead, JComponent target) {
        allignBottom(lead, target, -1, -1);
    }//from  w  ww .j ava2 s.  c  om

    public static void allignBottom(JComponent lead, JComponent target, int width, int height) {
        Rectangle rLead = lead.getBounds();
        Rectangle rTarget = target.getBounds();
        rTarget.x = rLead.x;
        rTarget.y = rLead.y + rLead.height;
        if (width > 0) {
            rTarget.width = width;
        }
        if (height > 0) {
            rTarget.height = height;
        }
        target.setBounds(rTarget);
    }
}

Related

  1. centerComponent(final JComponent target)
  2. centerOnComponet(Window target, JComponent parent)
  3. checkComponents(final Component _rootComponent, final String _print, final int _currentColumn, final int _currentRow)
  4. findMainRootPane(Component component)