fixing issues in desktop java tutorial

http://www.code.opencv.org/issues/2807