Jump to content

Question

Posted

can somebody help me to fix this code ? 

 

import java.awt.Desktop;
import java.net.URI;
import java.util.logging.Logger;

public final class SpecialServices
{
 private static final Logger _log = Logger.getLogger(SpecialServices.class.getName());
 
 public static void openBrowserURL(String url)
 {
  try
  {
   if (Desktop.isDesktopSupported())
   {
    Desktop.getDesktop().browse(new URI(url));
   }
   else
   {
    Runtime runtime = Runtime.getRuntime();
    runtime.exec("/usr/bin/firefox -new-window " + url);
   }
  }
  catch (Exception e)
  {
   _log.warning("Failed to open url " + url + " " + e.getMessage());
  }
 }
}

its working but with one problem.... when i press the button ingame ..... Browser is opened on VPS and not on my PC :'(

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..