Creating a JLabel with strike-through text

The easiest way is to use the HTML tag strike.

import java.awt.event.*;
import java.awt.font.*; 
import javax.swing.*;
import java.util.*;
import java.text.*;
import java.awt.*;
public class Main extends JFrame {
   public Main() {
      getContentPane().setLayout(new FlowLayout());
      JLabel label = new JLabel("<html><strike>Strike-through text</strike></html>");
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
      setSize(300, 200);
   public static void main(String[] args) {
      (new Main()).show();