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; }
@Override public void setSelectedIndex(int ind) { super.setSelectedIndex(ind); editor.setText(getItemAt(ind).toString()); editor.setSelectionEnd(caretPos + editor.getText().length()); editor.moveCaretPosition(caretPos); }