1
Well, I created a class :
import java.awt.Desktop;
import java.net.URI;
public class AbrirLink {
public static void main(String[] args){
try{
URI link = new URI("www.google.com");
Desktop.getDesktop().browse(link);
}catch(Exception erro){
System.out.println(erro);
}
}
}
I wanted to know how to call her inside a button, so when I click the button I opened the web page.
I created an Actionperformed on the Button and put the following code:
AbrirLink ab = new AbrirLink();
But I think there’s something else I need to do?
That’s what I told you to do...
URI link = new URI("www.google.com"); Desktop.getDesktop().browse(link);
– user148754