public static boolean displayURL(String url){
  if (displayUrlWithDesktopApi(url)) {
    return true;
  }
  if (displayUrlWithJnlpApi(url)) {
    return true;
  }
  Platforms platform=getPlatform();
switch (platform) {
case WINDOWS:
    return runCmdLine(replaceToken(WIN_CMDLINE,URLTOKEN,url));
case MAC:
  return runCmdLine(replaceToken(MAC_CMDLINE,URLTOKEN,url));
case LINUX:
if (runCmdLine(replaceToken(LINUX_CMDLINE,URLTOKEN,url))) {
  return true;
}
}
assert OTHER_CMDLINES.length == OTHER_FALLBACKS.length;
for (int i=0; i < OTHER_CMDLINES.length; i++) {
if (runCmdLine(replaceToken(OTHER_CMDLINES[i],URLTOKEN,url),replaceToken(OTHER_FALLBACKS[i],URLTOKEN,url))) {
return true;
}
}
return false;
}

public static boolean displayURL ( String url ) { if ( displayUrlWithDesktopApi ( url ) ) { return true ; } if ( displayUrlWithJnlpApi ( url ) ) { return true ; } Platforms platform = getPlatform ( ) ; switch ( platform ) { case WINDOWS : return runCmdLine ( replaceToken ( WIN_CMDLINE , URLTOKEN , url ) ) ; case MAC : return runCmdLine ( replaceToken ( MAC_CMDLINE , URLTOKEN , url ) ) ; case LINUX : if ( runCmdLine ( replaceToken ( LINUX_CMDLINE , URLTOKEN , url ) ) ) { return true ; } } assert OTHER_CMDLINES . length == OTHER_FALLBACKS . length ; for ( int i = 0 ; i < OTHER_CMDLINES . length ; i ++ ) { if ( runCmdLine ( replaceToken ( OTHER_CMDLINES [ i ] , URLTOKEN , url ) , replaceToken ( OTHER_FALLBACKS [ i ] , URLTOKEN , url ) ) ) { return true ; } } return false ; }
display an url in the system browser . if you want to display a file , you must include the absolute path name .
