How can I open a link in default browser with a button click, along the lines of
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
open("www.google.com"); // just what is the 'open' method?
}
});
?
Use the Desktop#browse(URI) method. It opens a URI in the user’s default browser.