List of utility methods to do JLabel Create
JComponent | createLabelledComponent(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); ... |
JPanel | createTabLabel(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()); ... |
JLabel | newJLabel(String n, char m, Component c) new J Label JLabel l = new JLabel(n); l.setDisplayedMnemonic(m); l.setLabelFor(c); return l; |