Java does not provide any way to plot pixels directly onto drawing surfaces. You have to create an image everytime!
The source code to this example is: