package com.mindprod.jcolourchooser;
import javax.swing.JFormattedTextField;
import javax.swing.JSpinner;
/**
* hex NumberEditor for a JSpinner.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2007-08-15
* @since 2007-08-15
*/
class HexNumberEditor extends JSpinner.NumberEditor
{
/**
* hex NumberEditor for a JSpinner.
* constructor
*
* @param spinner JSpinner this editor is attached to.
* @param width how many chars wide the field is.
*/
public HexNumberEditor( JSpinner spinner, int width )
{
super( spinner );
JFormattedTextField ftf = getTextField();
ftf.setEditable( true );
ftf.setFormatterFactory( new HexNumberFormatterFactory( width ) );
}
}