How can i use this code:
in a if statement like this:
import java.awt.Desktop; import java.net.URI;
public void main(String args[]) throws Exception { // Create Desktop object Desktop d=Desktop.getDesktop(); // Browse a URL, say google.com d.browse(new URI("http://google.com")); }
private void hover() { MainMenu world = (MainMenu) getWorld(); if(Greenfoot.mousePressed(this) && isInMainMenu == true) { this.setImage("MainMenuWebsite.png"); } else if(Greenfoot.mouseClicked(this) && isInMainMenu == true) { this.setImage("MainMenuWebsiteS.png"); ************** I want to open the browser at this location ************** } }