package test;

import java.awt.Color;
import javax.swing.JWindow;

public class Test
{
	/*
	  Demonstration of a timing problem causing random pixels to be (temporarily) displayed.

    Steps to demonstrate:

	  1. Put a breakpoint on the call to clearBackground() in LWWindowPeer.replaceSurfaceData(). The goal is to
	     insert a delay.
	  2. Optionally, put a breakpoint on the call to isKeyWindow() in CPlatformWindow.setVisible(). The goal is to freeze the
	     display of the random pixels before Java paints over them.
	  3. Run the program under the debugger. The first breakpoint will be hit several times. Just continue each time.
	*/

	public Test()
	{
		Color clear = new Color(255, 0, 0, 50);

		JWindow w = new JWindow();
		w.setBounds(100, 200, 600, 600);
		w.addNotify();
		w.setBackground(clear);
		w.setVisible(true);
	}

	public static void main(String[] args)
	{
		new Test();
	}
}
