Java Swing Icon getDefaultIcon()

Here you can find the source of getDefaultIcon()

Description

get Default Icon

License

Open Source License

Declaration

private static Icon getDefaultIcon() 

Method Source Code

//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);
    }
}

Related

  1. getApplicationIcons()
  2. getBadgedIcon(Icon icon, Icon badge)
  3. getbtnIcon(String iconpath)
  4. getbtniconpresspress(String Iconpath1, String pressIconpath2, String pressIconpath3)
  5. getClosestIcon(Collection icons, int height)
  6. getDefaultIcon()
  7. getDefaultIcon()
  8. getEmptyIcon()
  9. getFolderIcon()