I recently had a need to use hyperlinks (though I did not use it eventually). Here is a snippet to create hyperlinks in using Eclipse SWT.
/*
* Specific to Eclipse SWT
* Related packages
* - org.eclipse.swt.widgets.Link
* - org.eclipse.swt.events.SelectionAdapter
* - org.eclipse.swt.events.SelectionEvent
* - org.eclipse.swt.SWT
* - org.eclipse.swt.program.Program
*/
final Link link = new Link(parent, SWT.NONE);
link.setText(“Visit OpenBiomind-GUI homepage”);
/*
* You can use Selection Listener to identify the text that was clicked.
* For e.g. here when user clicks on the hyperlink named OpenBiomind-GUI
* then its href text, that is, http://code.google.com/p/openbiomind-gui/
* is set as event.text.
*/
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent event) {
// this will open the hyperlink in the default web browser
Program.launch(event.text);
}