Example usage for java.awt Checkbox setState

List of usage examples for java.awt Checkbox setState

Introduction

In this page you can find the example usage for java.awt Checkbox setState.

Prototype

public void setState(boolean state) 

Source Link

Document

Sets the state of this check box to the specified state.

Usage

From source file:gdsc.smlm.ij.plugins.PeakFit.java

public void itemStateChanged(ItemEvent e) {
    Checkbox cb = (Checkbox) e.getSource();
    if (cb.getState()) {
        cb.setState(false);
        PSFCalculator calculator = new PSFCalculator();
        calculatorSettings.pixelPitch = calibration.nmPerPixel / 1000.0;
        calculatorSettings.magnification = 1;
        calculatorSettings.beamExpander = 1;
        double sd = calculator.calculate(calculatorSettings, true);
        if (sd > 0)
            textInitialPeakStdDev0.setText(Double.toString(sd));
    }//from w w  w. jav  a 2  s.  co  m
}

From source file:gdsc.smlm.ij.plugins.CreateData.java

public void itemStateChanged(ItemEvent e) {
    // When the checkbox is clicked, output example compounds to the ImageJ log
    Checkbox cb = (Checkbox) e.getSource();
    if (cb.getState()) {
        cb.setState(false);

        logExampleCompounds();/*from   w  w w.ja va  2s  .co  m*/
    }
}