Page 1 of 1

Starting up Compiere forms and windows from java main method

PostPosted: Fri Jul 15, 2005 6:25 pm
by neilg
This can be a timesaver in terms of development.

Open up a form:

Code: Select all
public static void main(String[] args)
{
      Compiere.startupClient();
      Env.setContext(Env.getCtx(), "#AD_Client_ID", 1000000);
      Env.setContext(Env.getCtx(), "#AD_Org_ID", 0);

      FormFrame frame1 = new FormFrame();
      frame1.openForm(1000001);
      //frame1.setSize(800, 600);
      frame1.show();
   }

PostPosted: Sat Jul 16, 2005 1:07 am
by red1
Pls explain :roll:

PostPosted: Sun Jul 17, 2005 6:21 pm
by neilg
The idea is that instead of opening Compiere eveyrtime (Run Compiere from eclipse, then open your form, etc) which takes some time. Instead you put the main method mentioned above into the class which you are developing (or even another class depending how you want to structure it) and it starts up Compiere without you having to login, select the org, and open the form. (You create a new Run profile in Eclipse for that specific class).

There is also code for windows and processes but I still have to dig them out of the source code.

Is there maybe a better way of doing this?