Example usage for javax.swing.event ChangeListener interface-usage

List of usage examples for javax.swing.event ChangeListener interface-usage

Introduction

In this page you can find the example usage for javax.swing.event ChangeListener interface-usage.

Usage

From source file BoundedChangeListener.java

class BoundedChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent changeEvent) {
        Object source = changeEvent.getSource();
        if (source instanceof JProgressBar) {
            JProgressBar theJProgressBar = (JProgressBar) source;
            System.out.println("ProgressBar changed: " + theJProgressBar.getValue());

From source file BoundedChangeListener.java

class BoundedChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent changeEvent) {
        Object source = changeEvent.getSource();
        if (source instanceof JProgressBar) {
            JProgressBar theJProgressBar = (JProgressBar) source;
            System.out.println("ProgressBar changed: " + theJProgressBar.getValue());

From source file IconEditor.java

class IconEditor extends JLabel implements ChangeListener {
    JSpinner spinner;
    Icon icon;

    public IconEditor(JSpinner s) {
        super((Icon) s.getValue(), CENTER);

From source file BoundedChangeListener.java

class BoundedChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent changeEvent) {
        Object source = changeEvent.getSource();
        if (source instanceof BoundedRangeModel) {
            BoundedRangeModel aModel = (BoundedRangeModel) source;
            if (!aModel.getValueIsAdjusting()) {

From source file BoundedChangeListener.java

class BoundedChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent changeEvent) {
        Object source = changeEvent.getSource();
        if (source instanceof BoundedRangeModel) {
            BoundedRangeModel aModel = (BoundedRangeModel) source;
            if (!aModel.getValueIsAdjusting()) {

From source file Main.java

class MyChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent e) {
        System.out.println("A ChangeEvent has been fired!");
    }
}

From source file Main.java

class SpinnerListener implements ChangeListener {
    public void stateChanged(ChangeEvent evt) {
        JSpinner spinner = (JSpinner) evt.getSource();

        // Get the new value
        Object value = spinner.getValue();

From source file DualListener.java

class DualListener implements ActionListener, ChangeListener {
    public void actionPerformed(ActionEvent e) {
        System.out.println("dual: Action " + e);
    }

    public void stateChanged(ChangeEvent e) {

From source file Main.java

class MyChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent e) {
        System.out.println("A ChangeEvent has been fired!");
    }
}

From source file Main.java

class MyChangeListener implements ChangeListener {
    public void stateChanged(ChangeEvent e) {
        System.out.println("A ChangeEvent has been fired!");
    }
}