Java JSpinner getSpinnerFormatter(JSpinner spinner)

Here you can find the source of getSpinnerFormatter(JSpinner spinner)

Description

get Spinner Formatter

License

Open Source License

Declaration

public static DefaultFormatter getSpinnerFormatter(JSpinner spinner) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;
import javax.swing.text.DefaultFormatter;

public class Main {
    public static DefaultFormatter getSpinnerFormatter(JSpinner spinner) {
        JComponent comp = spinner.getEditor();
        JFormattedTextField field = (JFormattedTextField) comp.getComponent(0);
        return (DefaultFormatter) field.getFormatter();
    }//from   w w w. j  a v  a  2  s.  c  om
}

Related

  1. getFloat(JSpinner spinner)
  2. getInt(JSpinner spinner)
  3. getInt(SpinnerNumberModel model)
  4. getOnlySpinner(Container owner)
  5. getSpinnerFloatValue(JSpinner sp)
  6. getSpinnerInt(JSpinner aSpinner)
  7. getSpinnerIntValue(final JSpinner spinner)
  8. getSpinnerIntValue(JSpinner spin)
  9. installSpinnerBugWorkaround(final JSpinner spinner)