Java Utililty Methods JLabel Create

List of utility methods to do JLabel Create

Description

The list of methods to do JLabel Create are organized into topic(s).

Method

JComponentcreateLabelledComponent(JLabel label, Component component)
create Labelled Component
Box box = new Box(BoxLayout.X_AXIS) {
    public Dimension getMaximumSize() {
        return getPreferredSize();
};
box.add(label);
box.add(Box.createHorizontalStrut(3));
box.add(component);
...
JPanelcreateTabLabel(JLabel label, int width)
create Tab Label
label.setVerticalTextPosition(SwingConstants.TOP);
label.setHorizontalTextPosition(SwingConstants.LEADING);
final JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
if (width > 0)
    panel.add(Box.createHorizontalStrut(width));
panel.add(label);
panel.add(Box.createHorizontalGlue());
...
JLabelnewJLabel(String n, char m, Component c)
new J Label
JLabel l = new JLabel(n);
l.setDisplayedMnemonic(m);
l.setLabelFor(c);
return l;