Notes from the bug and comments:
1. setVisible() should be called at the end of the peers initialization.
We can move super.initialize() to the end of the peers initializations.
Initialize() was split to initialize() and initializeImpl(). In the
initialize() we call initializeImpl and then we call to setVisible().
initializeImpl overridden in subclasses.
2. Invokelater in the initialization/disposing is a tricky.
Left it as is. Probably later it will be changed. Comments was updated.
3. replaceSurfacedata() should be moved outside of LWWindowPeer.setVisible()
Done. Also duplicate code was extracted to setVisible() method which
4. Backbuffer in replaceSurfacedata() should be initialized by clearRect
instead of fillrect(composite is important).
Done. related to composite.
5. During lwwindowpeer initialization we call two similar methods
nativeSetNSWindowAlpha() and setAlphaValue().
nativeSetNSWindowAlpha() removed from CPlatformWindow.java.