Re: How to start default browser when clicking on a label



Helmut Tessarek wrote:
Hi,

I was wondering how I can implement a JLabel that references to a http link.
When I click that label the default browser should open and loading the webpage.
This is for a JDialog 'About' window.
I've seen this several times, but I've no idea how to implement this with
Java/Swing.

Regards,
  Helmut

There is a free Java program out there called BrowserLauncher. It is free for commercial and non-commercial use, and may be modified nearly to your heart's content.


Find at http://browserlauncher.sourceforge.net/

Here is how I have invoked it under a button.

private void jLinkButton_actionPerformed() {
try {
BrowserLauncher.openURL(AppData.getOpenLink());
System.out.println("BrowserLauncher.openURL(" + AppData.getOpenLink() + ")");
} catch (IOException e) {
AppError.errorMessage(e);
}
}
--



Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________


'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)
.