Skip to content

Commit

Permalink
Fixed Visit on GitHub not working on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKunal committed Nov 16, 2016
1 parent 598d142 commit e5c26ce
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/beatboxer/BeatBoxerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

import com.sun.deploy.uitoolkit.impl.fx.HostServicesFactory;
import com.sun.javafx.application.HostServicesDelegate;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Optional;
Expand Down Expand Up @@ -350,10 +352,15 @@ private void showHelp(){
alert.setContentText("BeatBoxer is made by:\nKunal Gupta, Shivam Tayal & Punit Lakshwani.");
Optional<ButtonType> result = alert.showAndWait();
if(result.get()==github){
String url = "https://goo.gl/fl49zi";
try {
new ProcessBuilder("x-www-browser", "https://goo.gl/fl49zi").start();
new ProcessBuilder("x-www-browser", url).start(); //Linux
} catch (IOException e) {
;
try {
Desktop.getDesktop().browse(new URI(url)); //Windows
} catch (Exception e1) {
;
}
}
}
}
Expand Down

0 comments on commit e5c26ce

Please sign in to comment.