Here you can find the source of leftAlignJLabel(JLabel label)
public static Box leftAlignJLabel(JLabel label)
//package com.java2s; // it under the terms of the GNU General Public License as published by // import javax.swing.*; public class Main { public static Box leftAlignJLabel(JLabel label) { Box box = Box.createHorizontalBox(); box.add(label);//www . j av a 2 s .c o m box.add(Box.createHorizontalGlue()); return box; } }