Hello there community :),
So I’m a real java newb, right? I can’t seem to get a URL to open from my LINK GUI. At the moment, it just shows the fields value.
Here is my handler.java code:
google = new JButton("Google");
google.setToolTipText("Open Google");
add(google);
I want it to open a URL instead of showing the fields value. This is my actionlistener code:
private class HandlerClass implements ActionListener {
public void actionPerformed(ActionEvent event) {
JOptionPane.showMessageDialog(null, String.format("%s", event.getActionCommand()));
}
}
If this is possible, can I get some assistance? 🙂 Thanks
See
Desktop.browse(URI).No, that is what will happen when you attempt to call an instance method on a class. You need a
Desktopobject.