Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {

    public static void main(String[] a) {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        String htmlLabel = "<html><sup>HTML</sup> <sub><em>Label</em></sub><br>"
                + "<font color=\"#FF0080\"><u>Multi-line</u></font>";
        JLabel label = new JLabel(htmlLabel);

        System.out.println(label.getText());

        frame.add(label);

        frame.setSize(300, 200);
        frame.setVisible(true);

    }
}