SwingUtilities.invokeLater(new Runnable() { public void run() { s.grabFocus(); } });
   private void jbInit() throws Exception {      this.setSize(new Dimension(400,300));      Properties sesProps = new Properties();      // Start loading properties - Host must exist      sesProps.put(SESSION_HOST,getParameter("host"));      if (isSpecified("-e"))         sesProps.put(SESSION_TN_ENHANCED,"1");      if (isSpecified("-p")) {         sesProps.put(SESSION_HOST_PORT,getParameter("-p"));      }//      if (isSpecified("-f",args))//         propFileName = getParm("-f",args);      if (isSpecified("-cp"))         sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp"));      if (isSpecified("-gui"))         sesProps.put(SESSION_USE_GUI,"1");      if (isSpecified("-132"))         sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR);      else         sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR);      // socks proxy host argument      if (isSpecified("-sph")) {         sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph"));      }      // socks proxy port argument      if (isSpecified("-spp"))         sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp"));      // check if device name is specified      if (isSpecified("-dn"))         sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn"));      if (isSpecified("-L"))         LangTool.init(parseLocale(getParameter("-L")));      else         LangTool.init();      manager = new SessionManager();      Session s = manager.openSession(sesProps,"","Test Applet");      s.grabFocus();      this.getContentPane().add(s);      s.connect();   }