當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。