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.

Main.java:

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>esus.com<html>");
      getContentPane().add(label);     
 
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
            System.exit(0);   
         }      
      });
 
      pack();
   }
 
   public static void main(String[] args) {
      (new Main()).show();
   }
}