Re: How to start default browser when clicking on a label
- From: IchBin <weconsul@xxxxxxx>
- Date: Sun, 27 Nov 2005 23:03:27 -0500
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-) .
- Follow-Ups:
- Re: How to start default browser when clicking on a label
- From: Helmut Tessarek
- Re: How to start default browser when clicking on a label
- References:
- How to start default browser when clicking on a label
- From: Helmut Tessarek
- How to start default browser when clicking on a label
- Prev by Date: How to start default browser when clicking on a label
- Next by Date: menonic without alt key (or similar)
- Previous by thread: How to start default browser when clicking on a label
- Next by thread: Re: How to start default browser when clicking on a label
- Index(es):