Hello
 
I have tried to hide the standard error dialog like in the file below.I get my Frame but the standard dialog comes up before. How could i hide it????
 
Regards
 
Code:
 public static void main(String[] args) throws MalformedURLException {
  if (args.length < 2) {
   throw new IllegalArgumentException("JNLP file parameters <urlString> and <keepAliveInterval> are mandatory.\n\n" + USAGE_TEXT);
  }
 
  String urlString = getUrlString(args);
  int keepAliveInterval = getKeepAliveInterval(args);
  String logLevel = getLogLevel(args);
  Properties userParameters = getUserParameters(args);
 
  if (logLevel != null) {
   if (LogManager.getLogManager() instanceof SimpleLogManager) {
    SimpleLogManager simpleLogManager = (SimpleLogManager) LogManager.getLogManager();
    simpleLogManager.setLevel(Level.parse(logLevel));
   }
  }
 
  //DefaultJnlpLauncher launcher = new DefaultJnlpLauncher();
  PhxIPJNLPLauncher launcher = new PhxIPJNLPLauncher();
  URL url = "" URL(urlString);
  launcher.start(new ServletConnector(new CookieRequestPropertyStore(url), url, keepAliveInterval), userParameters);
 }
 
 private static Properties getUserParameters(String[] args) {
  Properties result = new Properties();
  for (Iterator i = Arrays.asList(args).iterator(); i.hasNext();) {
   String key = (String) i.next();
   if (key.startsWith("-")) {
    key = key.substring(1);
    if (!i.hasNext()) {
     throw new IllegalArgumentException("User parameters must have format -<key> <value>.");
    }
 
    result.put(key, i.next());
   }
  }
 
  return result;
 }
 
 private static int getKeepAliveInterval(String[] args) {
  try {
   return Integer.parseInt(args[1]);
  } catch (NumberFormatException e) {
   throw new IllegalArgumentException("Parameter <keepAliveInterval> must be an integer.");
  }
 }
 
 private static String getUrlString(String[] args) {
  return args[0];
 }
 
 private static String getLogLevel(String[] args) {
  if (args.length < 3) {
   return null;
  }
 
  String result = args[2];
  return !result.startsWith("-") ? result : null;
 }
 
 public PhxIPJNLPLauncher() {
  ClientEnvironmentAdapter.setBrowserService(new JnlpBrowserService());
  ClientEnvironmentAdapter.setFileService(new JnlpFileService());
  UISession.setExitOnLastSessionStop(true);
 }
 
 public UISession start(IConnector connector, Properties userParameters) {
  System.out.println("---------- start -------------");
  UISession session = new UISession(connector, userParameters);
  session.addSessionStateListener(createSessionStateListener());
  session.addSessionStateListener(this);
  session.start();
  return session;
 }
 
 protected ISessionStateListener createSessionStateListener() {
  return new DefaultSessionStateListener();
 }
 
 public void sessionEnded(UISession session) {
  System.out.println("---------- sessionEnded -------------");
 }
 
 public void sessionStarted(UISession session) {
  System.out.println("---------- sessionStarted -------------");
 }
 
 public void sessionError(UISession session, Throwable reason) {
  //  try {
  JDialog f = new JDialog();
  f.add(new JScrollPane(new JLabel(reason.toString())));
  f.setModal(true);
  f.setVisible(true);
 
  //  } catch (IOException e) {
  //   // TODO Auto-generated catch block
  //   e.printStackTrace();
  //  }
  //  reason.printStackTrace();
 }
 
 public static void showMessageDialog(String windowTitle, String message, Throwable reason) {
  reason.printStackTrace();
  //  new ErrorDialog(windowTitle, message, reason).show();
 }
 
 public static void showMessageDialog(String windowTitle, String message, String reason) {
  System.out.println(reason);
  //  new ErrorDialog(windowTitle, message, reason).show();
 }
 

Torsten Hofmann
Dipl. - Informatiker (FH)
IT Consultant Business Integration
 
Würth Phoenix GmbH
Drillberg 6
D-97980 Bad Mergentheim

(Phone: +49 7931 91 6284
7 Fax: +49 7931 91 7284
+E-Mail: torsten.hofmann@wuerth-phoenix.de
 
    Website: www.wuerth-phoenix.de

 

Reply via email to