List of utility methods to do JLabel
BufferedImage | getStroke(final JLabel _jlbl_stroke) Apply stroke on background. final int strokeDistance = 10; if (_jlbl_stroke.getWidth() > 0 && _jlbl_stroke.getHeight() > 0 ) { BufferedImage bi_stroke = new BufferedImage(_jlbl_stroke.getWidth(), _jlbl_stroke.getHeight(), BufferedImage.TYPE_INT_ARGB); for (int x = 0; x < bi_stroke.getWidth(); x++) { for (int y = 0; y < bi_stroke.getHeight(); y++) { try { ... |
int | getTimeWidth(JLabel label) get Time Width if (dateWidth == -1) { try { DateFormat dfi = new SimpleDateFormat("dd MMM yyyy HH:mm:ss", Locale.US); String t = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT) .format(dfi.parse("22 Dec 2008 11:22:22")); final JLabel jLabel = new JLabel(t); jLabel.setFont(label.getFont()); dateWidth = jLabel.getPreferredSize().width; ... |
void | highlightLabel(JLabel label) Highlight label (both color and size) label.setFont(boldFont); label.setForeground(highlightColor); |
Box | leftAlignJLabel(JLabel label) left Align J Label Box box = Box.createHorizontalBox();
box.add(label);
box.add(Box.createHorizontalGlue());
return box;
|
int | parseIntFromLabel(JLabel jLabel) parse Int From Label return parseIntFromLabel(jLabel, 0);
|
void | setBoundsForJLabel(JLabel label, int xOffset, int yOffset) set Bounds For J Label setBoundsForComponent(label, label.getText(), xOffset, yOffset); |
void | setErrorBackground(JLabel comp) set Error Background comp.setBackground(ERROR_BACKGROUND); |
void | setMnemonic(JLabel label, JComponent message, char mnemonic) set Mnemonic label.setDisplayedMnemonic(mnemonic); label.setLabelFor(message); |
void | setModelValue(JLabel lbl, String value) set Model Value if (value != null) {
lbl.setText(value);
|
void | setNSLabel(JLabel nsLabel, String str) set NS Label nsLabel.setText(str); nsLabel.setToolTipText(str); |