public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { int oldDay = selectedDay; int oldMonth = selectedMonth; int oldYear = selectedYear; String dayString = ((JToggleButton) e.getItem()).getText(); try { selectedDay = Integer.parseInt(dayString); } catch (Exception ex) { selectedDay = 1; } selectedMonth = displayMonth; selectedYear = displayYear; if (oldDay != selectedDay || oldMonth != selectedMonth || oldYear != selectedYear) { isNullDate = false; selectedCalendar.set(Calendar.YEAR, selectedYear); selectedCalendar.set(Calendar.MONTH, selectedMonth); selectedCalendar.set(Calendar.DATE, selectedDay); updateCalendarComponents(); fireDateChange(); } } }
public void itemStateChanged(ItemEvent evt) { if (evt.getSource() instanceof JOAJRadioButton) { JOAJRadioButton rb = (JOAJRadioButton) evt.getSource(); if (rb == b1 && evt.getStateChange() == ItemEvent.SELECTED) { mOffset = JOAConstants.PROFSEQUENCE; setXRangeToSequence(); } else if (rb == b2 && evt.getStateChange() == ItemEvent.SELECTED) { mOffset = JOAConstants.PROFDISTANCE; setXRangeToDistance(); } else if (rb == b3 && evt.getStateChange() == ItemEvent.SELECTED) { mOffset = JOAConstants.PROFTIME; setXRangeToTime(); } } else if (evt.getSource() instanceof JOAJCheckBox) { } else if (evt.getSource() instanceof JOAJComboBox) { JOAJComboBox cb = (JOAJComboBox) evt.getSource(); if (cb == presetColorSchemes) { int colorScheme = cb.getSelectedIndex(); if (colorScheme == 0) { // default bg plotBg.setColor(JOAConstants.DEFAULT_CONTENTS_COLOR); axesColor.setColor(Color.black); } else if (colorScheme == 1) { // white bg plotBg.setColor(Color.white); axesColor.setColor(Color.black); } else { // color bg plotBg.setColor(Color.black); axesColor.setColor(Color.white); } } else if (cb == mSymbolPopup) { mCurrSymbol = cb.getSelectedIndex() + 1; } } generatePlotName(); }
@Override public void itemStateChanged(ItemEvent ev) { if (ev.getStateChange() == ItemEvent.SELECTED) { SwingUtilities.invokeLater( new Runnable() { @Override public void run() { String newPainterName = ((myjava.gui.syntax.Painter) (painterComboBox.getSelectedItem())).getName(); cardLayout.show(centerPanel, newPainterName); centerPanel.revalidate(); centerPanel.repaint(); } }); } }
public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == ItemEvent.SELECTED) { int index = getSelectedIndex(); int lower = _lower[index]; int upper = _upper[index]; MMultiplicity mult = null; if (lower >= 0) { mult = new MMultiplicity(lower, upper); } try { _setMethod.invoke(_container.getTarget(), new Object[] {mult}); } catch (Exception e) { System.out.println(e.toString() + " in UMLMultiplicityComboBox.itemStateChanged()"); } } }
@Override public void itemStateChanged(ItemEvent event) { if (event.getStateChange() == ItemEvent.SELECTED) gui.getTestText().setForeground(FontManager.COLORS[gui.getBox().getSelectedIndex()]); }
public void itemStateChanged(ItemEvent i) { if (i.getStateChange() == ItemEvent.SELECTED) co = (String) i.getItem(); z = 1; }