Here you can find the source of getDefaultIcon()
private static Icon getDefaultIcon()
//package com.java2s; import javax.swing.*; import java.awt.image.BufferedImage; import java.awt.*; import java.awt.geom.GeneralPath; public class Main { private static Icon getDefaultIcon() { BufferedImage bi = new BufferedImage(18, 18, 3); Graphics2D g2 = bi.createGraphics(); g2.setBackground(Color.red); g2.clearRect(0, 0, bi.getWidth(), bi.getHeight()); g2.setColor(Color.white); g2.setStroke(new BasicStroke(2.0F)); GeneralPath x = new GeneralPath(); x.moveTo(0.0F, 0.0F);/*from w w w .jav a2 s . c o m*/ x.lineTo(bi.getWidth() - 1, bi.getHeight() - 1); x.moveTo(0.0F, bi.getHeight() - 1); x.lineTo(bi.getWidth() - 1, 0.0F); g2.draw(x); return new ImageIcon(bi); } }