Difference between revisions of "Open a window (Swing UI) programmatically"
From iDempiere en
| Line 21: | Line 21: | ||
} | } | ||
</pre> | </pre> | ||
| + | |||
| + | [[Category:HowTo]] | ||
Revision as of 17:44, 17 October 2013
Opens the invoice window in Swing UI.
/**
* Opens invoice window
* @param c_invoice_id
*/
public boolean openInvoice(int c_invoice_id) {
// AD_Window_ID of customer invoice window
final int AD_Window_ID = 167;
String whereString = " C_Invoice_ID = " + c_invoice_id;
final AWindow poFrame = new AWindow();
final MQuery query = new MQuery("C_Invoice");
query.addRestriction(whereString);
final boolean ok = poFrame.initWindow(AD_Window_ID, query);
if (!ok)
return false;
poFrame.pack();
AEnv.showCenterScreen(poFrame);
AEnv.addToWindowManager(poFrame);
}
