当前位置: 首页>>代码示例>>Java>>正文


Java ChangeEvent类代码示例

本文整理汇总了Java中javax.swing.event.ChangeEvent的典型用法代码示例。如果您正苦于以下问题:Java ChangeEvent类的具体用法?Java ChangeEvent怎么用?Java ChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ChangeEvent类属于javax.swing.event包,在下文中一共展示了ChangeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: jSliderBreathingEffectSpeedStateChanged

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
private void jSliderBreathingEffectSpeedStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderBreathingEffectSpeedStateChanged
    if (breathingSpeedSliderManualChange) {
        return;
    }
    if (!jSliderBreathingEffectSpeed.getValueIsAdjusting()) {
        int speed = getSpeedFromSlider(Effects.Type.Breathing, jSliderBreathingEffectSpeed.getValue());
        if (gKeyboard.getEffect() != null) {
            if (gKeyboard.getEffect().BreathingSpeed != speed) {
                gKeyboard.getEffect().BreathingSpeed = speed;
                if (breathingThread != null) {
                    breathingThread.terminate();
                    breathingThread = null;
                }
                gKeyboard.getEffect().BreathingColour = IOOperations.getHexStringFromColour(jPanelBreathingColour.getBackground());
                breathingThread = new VirtualKeyboardBreathingThread();
                breathingThread.setKeyboardJpanels(getKeyboardJPanels(), jLayeredPane1);
                breathingThread.setSpeed(gKeyboard.getEffect().BreathingSpeed);
                breathingThread.setBreathingColour(gKeyboard.getEffect().BreathingColour);
                gKeyboard.setFXBreathing(gKeyboard.getEffect().BreathingColour, gKeyboard.getEffect().BreathingSpeed);
                breathingThread.start();
            }
        }
    }
}
 
开发者ID:MohamadSaada,项目名称:LogiGSK,代码行数:25,代码来源:G910SpectrumUKQWERTY.java

示例2: LiveFlatProfileCollectorPanel

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public LiveFlatProfileCollectorPanel(TargetAppRunner runner, CPUResUserActionsHandler actionsHandler,
                                     CPUSelectionHandler selectionHandler, boolean sampling) {
    super(actionsHandler, selectionHandler, sampling);
    //    setCPUSelectionHandler(selectionHandler);
    this.runner = runner;

    addFilterListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (flatProfileContainer != null) {
                setDataToDisplay(flatProfileContainer);
            }
        }
    });

    initComponents();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:LiveFlatProfileCollectorPanel.java

示例3: getControls

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public Component getControls() {

      final JSlider slider = new JSlider(JSlider.HORIZONTAL,0,100,opacity);

      final HashMap<Integer,JLabel> labelTable = new HashMap<Integer,JLabel>();
      labelTable.put(0, new JLabel("Transparent"));
      labelTable.put(100, new JLabel("Opaque"));

      slider.setMajorTickSpacing(10);
      slider.setPaintTicks(true);
      // Note: JSlider uses the outdated Hashtable. Eventually Hashtable
      // will be deprecated and we'll be able to use the HashMap directly.
      slider.setLabelTable(new Hashtable<Integer,JLabel>(labelTable));
      slider.setPaintLabels(true);
      slider.setBorder(javax.swing.BorderFactory.createTitledBorder(name));
      slider.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
          final JSlider source = (JSlider) e.getSource();
          if (!source.getValueIsAdjusting()) {
            opacity = source.getValue();
          }
        }});

      return slider;
    }
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:26,代码来源:ZoneHighlight.java

示例4: setTypeFields

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
private ChangeListener setTypeFields() {
    ChangeListener changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int count = (int) roomTypeSpinner.getValue();
            if (count > typeValue) {
                for (int i = 0; i < count; i++) {
                    roomTypeFields[i].setVisible(true);
                    roomTypeFields[i].revalidate();
                    roomTypeFields[i].repaint();
                }
            } else if (count < typeValue) {

                roomTypeFields[count].setVisible(false);
                roomTypeFields[count].revalidate();
                roomTypeFields[count].repaint();
            }
            typeValue = count;

        }
    };
    return changeListener;
}
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:24,代码来源:HotelPropertiesWindow.java

示例5: testFireForAll

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public void testFireForAll() throws IOException {
    final boolean [] received = new boolean[] {false};
    ChangeListener list;
    VisibilityQuery.getDefault().addChangeListener(list = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent ce) {
            received[0] = true;
        }
    });
    try {
        TestVCS.getInstance().getVisibilityQuery().fireVisibilityChanged();
        assertTrue(received[0]);
    } finally {
        VisibilityQuery.getDefault().removeChangeListener(list);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:VCSVisibilityQueryTest.java

示例6: PaletteChooser

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public PaletteChooser(ResourceManager resourceManager) {
    this.resourceManager = resourceManager;
    palette = new Palette(MAX_COLOR - MIN_COLOR, MIN_COLOR, MAX_COLOR,
            Math.toRadians(R_ANGLE), Math.toRadians(G_ANGLE),
            Math.toRadians(B_ANGLE), R_STEPS, G_STEPS, B_STEPS);
    shower = new JPaletteShower(palette, 250, 25);

    //<snip>Use single change listener for several spinners
    changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            setPalette(createPalette());
            shower.setPalette(palette);
            repaint();
        }
    };
    //</snip>

    setBorder(BorderFactory.createTitledBorder(
            resourceManager.getString("SpinnerDemo.colorPalette")));
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    add(shower);
    add(createControlPanel());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:PaletteChooser.java

示例7: editingStopped

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public void editingStopped(ChangeEvent e) {
    synchronized(mutex) {
        if (recursion) return;
        recursion = true;
    }
    try {
        // Take in the new value
        TableCellEditor editor = getCellEditor();
        if (editor != null) {
            editor.stopCellEditing();
            Object value = editor.getCellEditorValue();
            setValueAt(value, editingRow, editingColumn);
            removeEditor();
        }
    } finally {
        recursion = false;
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:19,代码来源:VariableTable.java

示例8: stateChanged

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public void stateChanged(ChangeEvent e) {
    if(wizardIterator==null) {
        return;
    }
    WizardDescriptor.Panel step = wizardIterator.current();
    if(step == null) {
        return;
    }
    if (step == cloneRepositoryWizardPanel) {
        errorMessage = cloneRepositoryWizardPanel.getErrorMessage();
    } else if (step == clonePathsWizardPanel) {
        //not validated during modification of text
        //errorMessage = clonePathsWizardPanel.getErrorMessage();
    } else if (step == cloneDestinationDirectoryWizardPanel) {
        errorMessage = cloneDestinationDirectoryWizardPanel.getErrorMessage();
    }
    if (wizardDescriptor != null) {
        wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, errorMessage); // NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:CloneWizardAction.java

示例9: tabbedPane_stateChanged

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
void tabbedPane_stateChanged(ChangeEvent e) {
	if (notesList != null)
		notesList.clearSelection();
	switch (tabbedPane.getSelectedIndex()) {
	case 0:
		notesList = notesListPanel.notesList;
		break;
	case 1:
		notesList = bookmarksListPanel.notesList;
		break;
	case 2:
		notesList = searchPanel.notesList;
		break;
	case 3:
		notesList = tagFilterPanel.notesList;
		break;
	}

	ppAddBkmrk.setEnabled(false);
	ppRemoveBkmrk.setEnabled(false);
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:22,代码来源:NotesControlPanel.java

示例10: start

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
/** Starts Eclipse importer wizard. */
public void start() {
    final EclipseWizardIterator iterator = new EclipseWizardIterator();
    final WizardDescriptor wizardDescriptor = new WizardDescriptor(iterator);
    iterator.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, // NOI18N
                    iterator.getErrorMessage());
        }
    });
    wizardDescriptor.setTitleFormat(new java.text.MessageFormat("{1}")); // NOI18N
    wizardDescriptor.setTitle(
            ProjectImporterWizard.getMessage("CTL_WizardTitle")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        projects = iterator.getProjects();
        //showAdditionalInfo(projects);
        destination = iterator.getDestination();
        recursively = iterator.getRecursively();
        numberOfImportedProjects = iterator.getNumberOfImportedProject();
        extraPanels = iterator.getExtraPanels();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ProjectImporterWizard.java

示例11: starsChangedListner

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
private ChangeListener starsChangedListner() {
    ChangeListener changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int count = (int) starsSpinner.getValue();
            if (count > starValue) {
                for (int i = 0; i < count; i++) {
                    starlabels[i].setVisible(true);
                    starlabels[i].revalidate();
                    starlabels[i].repaint();
                }
            } else if (count < starValue) {

                starlabels[count].setVisible(false);
                starlabels[count].revalidate();
                starlabels[count].repaint();
            }
            starValue = count;

        }
    };
    return changeListener;
}
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:24,代码来源:HotelPropertiesWindow.java

示例12: stateChanged

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
@Override
public void stateChanged(ChangeEvent event) {
    SwingUtilities.invokeLater(new Runnable() {

	@Override
	public void run() {
	    SwingUtilities.invokeLater(new Runnable() {

		@Override
		public void run() {
		    updateChart();
		}
	    });
	}
    });

}
 
开发者ID:tstavrianos,项目名称:automatic-variants,代码行数:18,代码来源:StatsPanel.java

示例13: stateChanged

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public void stateChanged(ChangeEvent e) {
	//stop editing text inside spinner
	try {
		classNumSpinner.commitEdit();
	} catch (ParseException pe) {
		//if string does not represent a number, return
		return;
	}
	//new number of classes
	int x = -1;
	try {
		x = ((Integer) classNumSpinner.getValue()).intValue();
	} catch (NumberFormatException nfe) {
	} catch (ClassCastException cce) {
	}
	//if new number is valid, proceed updating number
	if (x != -1) {
		setNumberOfClasses(x);
	} else {
		//otherwise, reset to 0
		classNumSpinner.setValue(new Integer(0));
	}
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:24,代码来源:ClassesPanel.java

示例14: changeData

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public void changeData(@NonNull TreeSet<String> privatePackages) {
    synchronized (IMPL_LOCK) {
        this.privatePackages = privatePackages;
    }

    ArrayList<ChangeListener> changes = new ArrayList<ChangeListener>();

    synchronized (listeners) {
        changes.addAll(listeners);
    }

    for (ChangeListener change : changes) {
        change.stateChanged(new ChangeEvent(this));
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ProjectWhiteListQueryImplementation.java

示例15: KeHuGuanLi

import javax.swing.event.ChangeEvent; //导入依赖的package包/类
public KeHuGuanLi() {
	setIconifiable(true);
	setClosable(true);
	setTitle("�ͻ���Ϣ����");
	JTabbedPane tabPane = new JTabbedPane();
	final KeHuXiuGaiPanel khxgPanel = new KeHuXiuGaiPanel();
	final KeHuTianJiaPanel khtjPanel = new KeHuTianJiaPanel();
	tabPane.addTab("�ͻ���Ϣ���", null, khtjPanel, "�ͻ����");
	tabPane.addTab("�ͻ���Ϣ�޸���ɾ��", null, khxgPanel, "�޸���ɾ��");
	getContentPane().add(tabPane);
	tabPane.addChangeListener(new ChangeListener() {
		public void stateChanged(ChangeEvent e) {
			khxgPanel.initComboBox();
		}
	});
	pack();
	setVisible(true);
}
 
开发者ID:Edward7Zhang,项目名称:SuperMarketManageSystem,代码行数:19,代码来源:KeHuGuanLi.java


注:本文中的javax.swing.event.ChangeEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。