Example usage for javax.swing SpinnerModel getValue

List of usage examples for javax.swing SpinnerModel getValue

Introduction

In this page you can find the example usage for javax.swing SpinnerModel getValue.

Prototype

Object getValue();

Source Link

Document

The current element of the sequence.

Usage

From source file:AddingChangeListenerToJSpinner.java

public static void main(String[] a) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    final JSpinner dateSpinner = new JSpinner();

    dateSpinner.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            SpinnerModel dateModel = dateSpinner.getModel();
            System.out.println(dateModel.getValue());
        }//from w w  w.j  ava  2 s . c  o  m
    });
    frame.add(dateSpinner, "North");

    frame.setSize(300, 200);
    frame.setVisible(true);
}

From source file:org.micromanager.CRISP.CRISPFrame.java

private void NASpinner_StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_NASpinner_StateChanged
    SpinnerModel numberModel = NASpinner_.getModel();

    float newNAValue = (Float) numberModel.getValue();
    try {//w  ww. ja v a2s.  c  o  m
        core_.setProperty(CRISP_, "Objective NA", newNAValue);
    } catch (Exception ex) {
        ReportingUtils.showError("Problem while setting LED intensity");
    }
}

From source file:org.micromanager.CRISP.CRISPFrame.java

private void LEDSpinner_StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_LEDSpinner_StateChanged
    SpinnerModel numberModel = LEDSpinner_.getModel();

    int newLEDValue = (Integer) numberModel.getValue();
    try {//from   w w w  .j a  v a 2s . com
        core_.setProperty(CRISP_, "LED Intensity", newLEDValue);
    } catch (Exception ex) {
        ReportingUtils.showError("Problem while setting LED intensity");
    }
}

From source file:org.micromanager.CRISP.CRISPFrame.java

private void GainSpinner_StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_GainSpinner_StateChanged
    SpinnerModel numberModel = GainSpinner_.getModel();

    int newGainValue = (Integer) numberModel.getValue();
    try {/*from ww  w .j a v a 2s.  com*/
        core_.setProperty(CRISP_, "GainMultiplier", newGainValue);
    } catch (Exception ex) {
        ReportingUtils.showError("Problem while setting LED intensity");
    }
}

From source file:org.micromanager.CRISP.CRISPFrame.java

private void NrAvgsSpinner_StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_NrAvgsSpinner_StateChanged
    SpinnerModel numberModel = NrAvgsSpinner_.getModel();

    int newNrAvgValue = (Integer) numberModel.getValue();
    try {//from   w  w w  .  j ava  2 s.co m
        core_.setProperty(CRISP_, "Number of Averages", newNrAvgValue);
    } catch (Exception ex) {
        ReportingUtils.showError("Problem while setting LED intensity");
    }
}