import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;

public class ListsInHTML {
    private static final String HTML_TEXT = "<html>" +
            "<style>" +
            "    p, ol { margin-top: 0em; margin-bottom: 0em }" +
            "</style>" +
            "<body>" +
            "<p>Rendering of HTML list markers.</p>\n" +
            "<p>Decimal list:</p>\n" +
            "<ol style=\"list-style-type: decimal\">\n" +
            "    <li>One ‘1’</li>\n" +
            "    <li>Two ‘2’</li>\n" +
            "    <li>Three ‘3’</li>\n" +
            "</ol>\n" +
            "<p>Lower alpha:</p>\n" +
            "<ol style=\"list-style-type: lower-alpha\">\n" +
            "    <li>Letter ‘a’</li>\n" +
            "    <li>Letter ‘b’</li>\n" +
            "    <li>Letter ‘c’</li>\n" +
            "</ol>\n" +
            "<p>Lower roman:</p>\n" +
            "<ol style=\"list-style-type: lower-roman\">\n" +
            "    <li>Item ‘i’</li>\n" +
            "    <li>Item ‘ii’</li>\n" +
            "    <li>Item ‘iii’</li>\n" +
            "</ol>\n" +
            "</body></html>\n";

    public static void main(String[] args) {
        SwingUtilities.invokeLater(ListsInHTML::new);
    }

    private ListsInHTML() {
        JEditorPane editorPane = new JEditorPane(
                "text/html", HTML_TEXT);
        editorPane.setEditable(false);

        JFrame frame = new JFrame("Lists in HTML");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(new JScrollPane(editorPane));
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}
