Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] hyperlink using SWT

On Fri, 2005-09-09 at 13:13 +0530, Vineet Puri wrote:
Could anyone please help me out in how to provide a hyperlink text using SWT. I got an example but its using html in SWT, and not working with other tools of SWT. Please could anyone help me out with an example including "heperlink text, menubar, text box "..etc.

	Label website = new Label(shell,SWT.CENTER);
	website.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL|GridData.FILL_HORIZONTAL));
	website.setText("http://www.maxprograms.com"); //$NON-NLS-1$
	website.setForeground(new Color(display,0x00,0x00,0xFF));
	website.addMouseListener(new MouseListener(){
			 
		 public void mouseDoubleClick(MouseEvent arg0) {
			 // do nothing				
		 }
			 
		 public void mouseDown(MouseEvent arg0) {
			 Program.launch("http://www.maxprograms.com");	 //$NON-NLS-1$
		 }
		 
		 public void mouseUp(MouseEvent arg0) {
			 // do nothing				
		 }
	 });

--
Rodolfo M. Raya <rodolfo@xxxxxxxxxxxxx>
Heartsome Holdings Pte Ltd

Back to the top