Code example for DefaultFormatterFactory

Methods: getDefaultFormatter

0
		super(spinner);
		//super(spinner,"0.0##"); 
		getTextField().setEditable(true);
		 
		DefaultFormatterFactory dff = (DefaultFormatterFactory) getTextField().getFormatterFactory();
		DefaultFormatter formatter = (DefaultFormatter) dff.getDefaultFormatter();
		formatter.setOverwriteMode(false);
	} 
 
	/** 
	 * Constructor which sets the number of columns in the editor. 
	 * @param spinner 
	 * @param cols 
	 */ 
	public SpinnerEditor(JSpinner spinner, int cols ) {
		this(spinner);
		getTextField().setColumns(cols);
	} 
	 
} 
Experience pair programming with AI  Get Codota for Java