public void run() { try { thread.sleep(1111); } catch (Exception e) { return; } Thread me = Thread.currentThread(); while (thread == me) { for (int i = 0; i < ImageOps.imgName.length; i++) { imgCombo.setSelectedIndex(i); for (int j = 0; j < ImageOps.opsName.length; j++) { opsCombo.setSelectedIndex(j); if (j <= 1) { for (int k = 50; k <= 200; k += 10) { demo.slider1.setValue(k); try { thread.sleep(200); } catch (InterruptedException e) { return; } } } try { thread.sleep(4444); } catch (InterruptedException e) { return; } } } } thread = null; }
private void initComboBox(JComboBox combo) { if (combo.getUI() instanceof WindowsComboBoxUI) { combo.setUI(new RightPopupWindowsComboBoxUI()); } else { combo.setUI(new RightPopupBasicComboBoxUI()); } combo.addPopupMenuListener(new RightPopupMenuListener()); }
@Override public void setSelectedIndex(int ind) { super.setSelectedIndex(ind); editor.setText(getItemAt(ind).toString()); editor.setSelectionEnd(caretPos + editor.getText().length()); editor.moveCaretPosition(caretPos); }
public void actionPerformed(ActionEvent e) { if (e.getSource().equals(opsCombo)) { demo.opsIndex = opsCombo.getSelectedIndex(); if (demo.opsIndex == 0) { demo.slider1.setValue(demo.low); demo.slider2.setValue(demo.high); demo.slider1.setEnabled(true); demo.slider2.setEnabled(true); } else if (demo.opsIndex == 1) { demo.slider1.setValue(demo.rescaleFactor); demo.slider2.setValue((int) demo.rescaleOffset); demo.slider1.setEnabled(true); demo.slider2.setEnabled(true); } else { demo.slider1.setEnabled(false); demo.slider2.setEnabled(false); } } else if (e.getSource().equals(imgCombo)) { demo.imgIndex = imgCombo.getSelectedIndex(); } demo.repaint(10); }
public DemoControls(ImageOps demo) { super(demo.name); this.demo = demo; setBackground(Color.gray); add(imgCombo = new JComboBox()); imgCombo.setFont(font); for (int i = 0; i < ImageOps.imgName.length; i++) { imgCombo.addItem(ImageOps.imgName[i]); } imgCombo.addActionListener(this); add(opsCombo = new JComboBox()); opsCombo.setFont(font); for (int i = 0; i < ImageOps.opsName.length; i++) { opsCombo.addItem(ImageOps.opsName[i]); } opsCombo.addActionListener(this); }
public boolean isDirty() { String newFilename = (String) _txtFilename.getSelectedItem(); return !_oldFilename.equals(newFilename); }
public String getAbsolutePath() { return _txtPath.getText() + File.separatorChar + _txtFilename.getSelectedItem() + _txtFileExt.getText(); }
protected void updateFilename() { _oldFilename = (String) _txtFilename.getSelectedItem(); }