Source Code : Use an Icon Editor for use with the JSpinner component

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Use an Icon Editor for use with the JSpinner component

   

import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

class IconEditor extends JLabel implements ChangeListener {
  JSpinner spinner;
  Icon icon;

  public IconEditor(JSpinner s) {
    super((Icon)s.getValue(), CENTER);
    icon = (Icon)s.getValue();
    spinner = s;
    spinner.addChangeListener(this);
  }

  public void stateChanged(ChangeEvent ce) {
    icon = (Icon)spinner.getValue();
    setIcon(icon);
  }

  public JSpinner getSpinner() { return spinner; }
  public Icon getIcon() { return icon; }
}

   
    
    
  

Thank with us