put synchronized block around FlatPanel.paintBuffer()