Here you can find the source of getFlowLayoutPanelLeftAligned(String title, Component component)
public static JPanel getFlowLayoutPanelLeftAligned(String title, Component component)
//package com.java2s; //License from project: Apache License import java.awt.Component; import java.awt.FlowLayout; import javax.swing.BorderFactory; import javax.swing.JPanel; public class Main { public static JPanel getFlowLayoutPanelLeftAligned(Component component) { return getFlowLayoutPanelLeftAligned(null, component); }/* w ww . java 2s. c o m*/ public static JPanel getFlowLayoutPanelLeftAligned(String title, Component component) { JPanel jp = new JPanel(); jp.setLayout(new FlowLayout(FlowLayout.LEFT)); if (title != null) { if (component instanceof JPanel) { JPanel p = (JPanel) component; p.setBorder(BorderFactory.createTitledBorder(title)); } } jp.add(component); return jp; } }