Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding Hyperlink To JLabel  RSS feed

 
Tony Hanks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,

I am making one application in which i have a leftmost panel on which i want some hyperlink action to be performed.

Eg.

Add label will do some action like u have in HTML
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want it to open a URL, or trigger a event within your application? To trigger an event, you'd add a listener. To open a URL in the users browser, you may want to look at BrowserLauncher (http://browserlauncher.sourceforge.net/)

If you can provide more information on what you're trying to do, and perhaps post the code that you're working with, you're more likely to get answers that are helpful.
 
Tony Hanks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i have not yet started the code,i am in designing phase only.
I have 2 panels in an application in which i need to have some componenet in panel1(Leftmost Panel) so that on clicking that component i can refresh something in the right panel,like you have in the javadocs html page.You have the classes in the left frame and on clicking on any of the class you refresh your right panel.

So,basically i want the same functionality in my Java Swing client.

I hope you understand my question or should i rephrase it again.

Thanks in advance.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could render the information on the left as a series of JLabels and add MouseListeners to each of them, JLabels can be dressed up with HTML. ..or you could render the information in a JList and then you would only have to work with one Listener and one component. I think the JList would be much easier.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!