void (boolean left) { synchronized (myLock) { if (myImages == null) { return; } int count = myImages.size(); if (count < 2) { return; } if (left) { if (myCurrentImage > 0) { myCurrentImage--; } else { myCurrentImage = count - 1; } } else if (myCurrentImage < count - 1) { myCurrentImage++; } else { myCurrentImage = 0; } } repaint(); }