Creating a JLabel with the text on top of the image

You can play around with the methods setHorizontalTextAlignment and setVerticalTextAlignment as shown in the following example:

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