io.github.parubok.text.multiline.MultilineLabelUI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multiline-label Show documentation
Show all versions of multiline-label Show documentation
Java Swing component to display multiline text
package io.github.parubok.text.multiline;
import javax.swing.JComponent;
import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI;
import java.awt.Graphics;
/**
* UI delegate of {@link MultilineLabel}.
*/
public class MultilineLabelUI extends ComponentUI {
@Override
public void installUI(JComponent c) {
LookAndFeel.installColorsAndFont(c, "Label.background", "Label.foreground", "Label.font");
}
@Override
public void paint(Graphics g, JComponent c) {
var label = (MultilineLabel) c;
g.setColor(label.getForeground());
g.setFont(label.getFont());
label.getTextLayout().paintText(g);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy