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

public final class HTMLStrike {
    private static final String HTML = """
            <!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <title>Strike-through text</title>
            </head>
            <body>
            <p><u><s>struck?</s></u></p>
            <p><span style='text-decoration: underline'><s>struck?</s></span></p>

            <p><u><strike>struck?</strike></u></p>
            <p><span style='text-decoration: underline'><strike>struck?</strike></span></p>
            </body>
            </html>
            """;

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

    private static void createUI() {
        JEditorPane html = new JEditorPane("text/html", HTML);
        html.setEditable(false);

        JFrame frame = new JFrame("Strike-through text");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.add(new JScrollPane(html));

        frame.pack();

        frame.setLocationByPlatform(true);
        frame.setVisible(true);
    }
}
