When exactly is the AWT thread started?

Sandip Chitale

Anytime the java.awt.Toolkit instance is (directly or indirectly) created. The direct way to create it is by calling-

Toolkit.getDefaultToolkit();

Indrect way is by creating any AWT object.

Here is a sample program to play with -

import java.awt.*;
public class X 
{
	static Frame f;
	
	public static void main(String[] args)
	{
		//Toolkit.getDefaultToolkit();
		f = new Frame();
		System.out.println("...");
	}
}

See also: What exactly is the "Event Dispatch" thread (aka "AWT" Thread)?
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact