Search code examples
javaswingjlabel

Two rows of text inside a JLabel


How to write text in two rows inside a JLabel ( It doesn't work with \n ) ?


Solution

  • Try to make it like this:
    JLabel myLabel = new JLabel("<html>this is line1<br>this is line2</html>");