Double buffering application written in java