Skip to content
Snippets Groups Projects
Select Git revision
  • b0e29b6a2becbe77c9720324b29c8ecb12329fcc
  • master default
  • dev_general
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
8 results

DoubleInputField.java

Blame
  • user avatar
    Philipp Spohr authored
    6b1ca84c
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    DoubleInputField.java 468 B
    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());
    	}
    }