you need to extract TableHeader
from TableHeader
and install Border
there, for example, Borders
only changed to 1st. Column

import java.awt.*; import javax.swing.*; import javax.swing.border.Border; import javax.swing.table.*; public class LabelHeaderSample { public static void main(String args[]) { Icon redIcon = new DiamondIcon(Color.red); Icon blueIcon = new DiamondIcon(Color.blue); Object rows[][] = {{"one", "ichi - \u4E00", new DiamondIcon(Color.red)}, {"two", "ni - \u4E8C", new DiamondIcon(Color.red)}, {"three", "san - \u4E09", new DiamondIcon(Color.red)}, {"four", "shi - \u56DB", new DiamondIcon(Color.red)}, {"five", "go - \u4E94", new DiamondIcon(Color.red)}, {"six", "roku - \u516D", new DiamondIcon(Color.red)}, {"seven", "shichi - \u4E03", new DiamondIcon(Color.red)}, {"eight", "hachi - \u516B", new DiamondIcon(Color.red)}, {"nine", "kyu - \u4E5D", new DiamondIcon(Color.red)}, {"ten", "ju - \u5341", new DiamondIcon(Color.red)}}; JFrame frame = new JFrame("Label Header"); String headers[] = {"English", "Japanese", "Icon"}; JTable table = new JTable(rows, headers); JScrollPane scrollPane = new JScrollPane(table); Border headerBorder = UIManager.getBorder("TableHeader.cellBorder"); JLabel blueLabel = new JLabel(headers[0], blueIcon, JLabel.CENTER); blueLabel.setBorder(null);
source share