label = new JLabel("A label");
label.setFont(new Font("Serif", Font.PLAIN, 14));
taken from How to Use HTML in Swing Components
More Related Contents:
- Centering a JLabel on a JPanel
- Scale the ImageIcon automatically to label size
- Getting fonts, sizes, bold,…etc
- Singleton design pattern vs Singleton beans in Spring container
- How can I use a custom font in Java?
- How returns XxxSize from JComponent(s) added to the JLabel
- Setting the Default Font of Swing Program
- Can I have a textfield inside a label?
- How to change font size in Eclipse for Java text editors?
- How much data can a List can hold at the maximum?
- dragging a jlabel around the screen
- How can I test if my font is rendered correctly in pdf?
- Issue when using a custom font – “native typeface cannot be made”
- Setting custom font
- Setting print size of a jLabel and put a jRadiobutton on the print
- Why is my JLabel not showing up
- Using custom font in android TextView using xml
- make a JLabel wrap it’s text by setting a max width
- Updating an image contained in a JLabel – problems
- How to remove gap in java swing label of large size
- Vertically centering text in HTML table cell in Java JLabel
- Convert text content to Image
- .setBounds not working for JLabel and JButton
- Update a Label with a Swing Timer
- SWT – OS agnostic way to get monospaced font
- Character display/search for Unicode characters
- Java PriorityQueue with fixed size
- How can I set size of a button?
- find out if text of JLabel exceeds label size
- How to increase java heap size programmatically