Here you can find the source of makeButtonBar(int align, Component... comps)
public static JPanel makeButtonBar(int align, Component... comps)
//package com.java2s; /**/*from w w w . j a v a2 s . c o m*/ * Copyright (c) 2010 Simon Denier * Released under the MIT License (see LICENSE file) */ import java.awt.Component; import java.awt.FlowLayout; import javax.swing.JPanel; public class Main { public static JPanel makeButtonBar(int align, Component... comps) { JPanel pan = new JPanel(new FlowLayout(align)); for (Component component : comps) { pan.add(component); } return pan; } }