Use HTML in setText, e.g.
myLabel.setText("<html><body>with<br>linebreak</body></html>");
More Related Contents:
- Newline in JLabel
- make a JLabel wrap it’s text by setting a max width
- Better AI for Tic & Toe [closed]
- error: illegal start of expression 1 error
- Netbeans GUI editor generating its own incomprehensible code
- Java and GUI – Where do ActionListeners belong according to MVC pattern?
- how to change UI depending on combo box selection
- Difference between validate(), revalidate() and invalidate() in Swing GUI
- java – How would I dynamically add swing component to gui on click?
- Drawing Multiple JComponents to a Frame
- JLabel – Show longer text as multiple lines?
- Stretch a JLabel text
- Multiline text in JLabel
- Resizing image in Java
- How to define multiple JButton actions from a different class
- Does adding a JLabel to a JPanel “hide” the JPanel?
- Drag and Drop custom object from JList into JLabel
- Swing vs JavaFx for desktop applications [closed]
- Listen to JFrame resize events as the user drags their mouse?
- List of Java Swing UI properties? [closed]
- How to make Circle image Label in Java?
- How to make AWT Button() and use ImageIcon(), Icon()?
- Java JLabel/JButton: on some systems I get “…” (an ellipsis) and on some systems I don’t. how can I force to disable the ellipsis at all?
- How can I make this JButton visible? When I have progressive scan background JWindow()?
- How to right-justify icon in a JLabel?
- Java Dialog – Find out if OK is clicked?
- How do I refresh a GUI in Java?
- Java Swing GUI Client and Server Chat App TextArea not updating
- How can I set size of a button?
- Can I add a component to a specific grid cell when a GridLayout is used?