Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class Main {
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setLayout(new BorderLayout());
        JLabel label = new JLabel("<html>" + "<img src=\"" + Main.class.getResource("/resource/path/to/image1.jpg")
                + "\">" + "<img src=\"" + Main.class.getResource("/resource/path/to/image2.jpg") + "\">"
                + "The text</html>");
        frame.add(label, BorderLayout.CENTER);
        frame.setBounds(100, 100, 200, 100);
        frame.setVisible(true);
    }
}