Here you can find the source of alignComponentsBaseHorizontal(Component left, Component right)
static public void alignComponentsBaseHorizontal(Component left, Component right)
//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 } }