click to a button to open link java swing code example
Example: java how to open a link
Runtime rt = Runtime.getRuntime();
String url = "https://www.example.com";
try {
rt.exec("rundll32 url.dll,FileProtocolHandler " + url);
} catch (IOException ioException) {
ioException.printStackTrace();
}