Creating a multi-line text JLabel

The easiest way is to hardcode HTML inside your JLabel text. JLabel has the functionality to render HTML. Another way is to write a custom Jlabel UI for your l&f that is able to understand escape sequences like n.

import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.awt.*;
public class Main extends JFrame {
   public Main() {
      getContentPane().setLayout(new FlowLayout());
      JLabel label = new JLabel("<html>Java resources at<br><html>");
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
   public static void main(String[] args) {
      (new Main()).show();