-2

I have taken one JFrame in which we have shown the information about our firm there is one information(label) like:

website: www.samteksystems.com I want that whenever I click on www.samteksystems.com it should display that website. Please help me in this.

Matt
  • 74,352
  • 26
  • 153
  • 180
amol
  • 1
  • 2
  • 2
  • 1
    Perhaps you want to add a MouseListener to the JLabel that holds the information, and in this MouseListener's mousePressed method, you would start the default browser and direct it to your page. – Hovercraft Full Of Eels Apr 04 '11 at 04:06
  • @Hovercraft Full Of Eels - perhaps this should have been posted as an answer instead of a comment! – user85421 Apr 04 '11 at 12:10

1 Answers1

4

You can add a mouseListener to the label, and in the mouseReleased() method, you could use Desktop.browse() to visit the URL.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186