package de.hhu.ba.yoshikoWrapper.gui;

import javax.swing.JFormattedTextField;

/**
 * Provides a more strict input field that only accepts double
 */
@SuppressWarnings("serial")
public class DoubleInputField extends JFormattedTextField{
	
	public DoubleInputField(double minValue,double maxValue) {
		super(FormatHelper.getDoubleFormatter(minValue,maxValue));
		this.setColumns(8);
	}

	public double getValueAsDouble() {
		return Double.parseDouble(getText());
	}
}