View Single Post
Old 06-10-2008, 06:42 AM   #3
irlennard
Knows Where the Search Button Is
 
irlennard's Avatar
 
Join Date: Jan 2008
Location: Berlin
Model: 9000
Carrier: T-Mobile
Posts: 32
Default

When you create your alternate entry project, make sure you enter something in the "Arguments passed to..." field (e.g. "my_argument").

Now, in your main class, your main() function looks like this:

Code:
public static void main(String[] args)
{
	if (args != null && args.length > 0 && args[0].equals("my_argument"))
	{
		// Alternate entry point

		// Do something here.
	}
	else
	{
		// Normal entry point
		// Start app and enter event dispatcher.
		TheApp theApp = new TheApp();
		theApp.enterEventDispatcher();
	}
}
Hope this helps.

-- IRL

Last edited by irlennard; 06-10-2008 at 06:43 AM..
Offline   Reply With Quote