jCheckbox Metro Style


 

Image Icon

  • Sediakan 3 buah icon untuk radio button, 20x20 pixel, hover, checked dan uncheck
  • Buat package/folder icon pada folder src {sourch packages), dan simpan ketiga icon di  dalamnya


 

Download Icon DISINI
 

Create Java Class

Example : jCheckBoxMetrostyle.java

import java.awt.Color;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;

public class jCheckBoxMetrostyle extends JCheckBox{

    public jCheckBoxMetrostyle() {
        this.setIcon(new ImageIcon(getClass().getResource("/icon/CHUnchek.png")));
        this.setRolloverIcon(new ImageIcon(getClass().getResource("/icon/CHHover.png")));
        this.setSelectedIcon(new ImageIcon(getClass().getResource("/icon/CHCheked.png")));
        this.setFont(new Font( "Segoe UI",Font.PLAIN ,12 ));
        this.setForeground(Color.white);
        this.setOpaque(false);
    }

}

Clean and Build

Right click java project, select clean and build

How to Use


 
  • Create Jframe 
  • Drag and drop jCheckBoxMetrostyle.java into jframe

Posting Komentar

0 Komentar