Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jadex.bdi.planlib;
 
 
The gui creator. Note! The Gui cannot be itself a JFrame because this might lead to deadlocks. new JFrame() should only be called from Swing thread. As "new JFrame()" is content of a belief it is executed in the agent's thread.
public class GuiCreator
	//-------- attributes --------
The gui.
	protected JFrame frame;
	//-------- constructors --------
Create a new clock.
	public GuiCreator(final Class frameclassfinal Class[] argclassesfinal Object[] args)
	{
		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				try
				{
					Constructor con = frameclass.getConstructor(argclasses);
					 = (JFrame)con.newInstance(args);
				}
				catch(Exception e)
				{
					throw new RuntimeException(e);
				}
			}
		});
	}

Create a new clock.
	public GuiCreator(final Method createmethodfinal Class[] argclassesfinal Object[] args)
	{
		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				try
				{
					 = (JFrame)createmethod.invoke(nullargs);
				}
				catch(Exception e)
				{
					throw new RuntimeException(e);
				}
			}
		});
	}
	//-------- methods --------
Get the frame.

Returns:
The frame.
	public JFrame getFrame()
	{
		return ;
	}
New to GrepCode? Check out our FAQ X