ImageViewer.repaint();

What is it you hope to redraw when you call this? Becuase as far as I am aware, that is COMPLETELY Illegal. The only way to call repaint is on an instance not class, ie as a...