Java Rectangle alignComponentsBaseHorizontal(Component left, Component right)

Here you can find the source of alignComponentsBaseHorizontal(Component left, Component right)

Description

align Components Base Horizontal

License

Open Source License

Declaration

static public void alignComponentsBaseHorizontal(Component left, Component right) 

Method Source Code


//package com.java2s;
import java.awt.Component;

import java.awt.Rectangle;

public class Main {
    static public void alignComponentsBaseHorizontal(Component left, Component right) {
        Rectangle leftBounds = left.getBounds();
        Rectangle rightBounds = right.getBounds();

        leftBounds.y = rightBounds.y + rightBounds.height - leftBounds.height;
        left.setBounds(leftBounds);//from w ww. ja v  a 2s .  c om
    }
}

Related

  1. addTo(Insets i1, Insets i2)
  2. alignsVertically(Rectangle r1, Rectangle r2)
  3. clip(int x, int y, int w, int h)
  4. computeDifference(Rectangle rectA, Rectangle rectB)
  5. expand(final Rectangle rect, final int expansion)