use of org.compiere.apps.ALogin in project adempiere by adempiere.
the class POSClient method main.
public static void main(String[] args) {
/** Properties */
Properties m_ctx = new Properties();
// needs to be here for UI
Adempiere.startup(true);
Splash splash = new Splash("POS Client");
final FormFrame frame = new FormFrame(new CFrame("POS Client"));
// Focus Traversal
KeyboardFocusManager.setCurrentKeyboardFocusManager(AKeyboardFocusManager.get());
ALogin login = new ALogin(splash);
if (// no automatic login
!login.initLogin()) {
// Center the window
try {
// HTML load errors
AEnv.showCenterScreen(login);
} catch (Exception ex) {
}
if (!login.isConnected() || !login.isOKpressed())
AEnv.exit(1);
}
// Check Build
if (!DB.isBuildOK(m_ctx))
AEnv.exit(1);
// Check DB (AppsServer Version checked in Login)
DB.isDatabaseOK(m_ctx);
splash.setText(Msg.getMsg(m_ctx, "Loading"));
splash.toFront();
//
if (// Load Environment
!Adempiere.startupEnvironment(true))
System.exit(1);
// Start Session
MSession.get(Env.getCtx(), true);
// Default Image
frame.setIconImage(Adempiere.getImage16());
splash.dispose();
splash = null;
POSClientWindow m_window;
m_window = new POSClientWindow(m_ctx);
m_window.setVisible(true);
}
Aggregations