Here you can find the source of getMandatoryPanel(JComponent c)
public static Component getMandatoryPanel(JComponent c)
//package com.java2s; //License from project: Apache License import java.awt.Component; import javax.swing.Box; import javax.swing.JComponent; import javax.swing.JLabel; public class Main { public static final String LABEL_MANDATORY = " *"; public static Component getMandatoryPanel(JComponent c) { Box box = Box.createHorizontalBox(); box.add(c);/* w w w.j a va2 s. c o m*/ box.add(new JLabel(LABEL_MANDATORY)); return box; } }