I am having problems adding a HTML strike-through tag to a string of text in Java.
EDIT: I have posted the entire code and I am using Windows 7, Java 8 and Swing.
JLabel LocalSelectorLabel = new JLabel("<html><strike>Text Here</strike><html>");
LocalSelectorLabel.setBounds(12, 50, 55, 16);
LocalTabPanel.add(LocalSelectorLabel);
I have tried the tags: s, del and strike but all of them just give me underlined text. I have looked around for other tags that might work but I haven't found anything.
EDIT 2: This works for me, thanks:
new JLabel("<html><body><span style='text-decoration: line-through;'>Text Here</span></body></html>");
EDIT 3: Now this is interesting. I ran the code on a different computer and that one displays as strike-through and as underline as expected while the computer I used to ask this question did not. I see now why I didn't find anything when I searched for a solution.
` and it worked just fine. Perhaps you should post more of your code, or tell us more specific details about the Java version and operating system.– RealSkeptic Nov 06 '15 at 10:08` tag contains a `/` before like `` ? – Gabriel Câmara Nov 06 '15 at 12:22