How to add a hyperlink in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to add a hyperlink in java?

Hey, can anyone tell me How to add a hyperlink in java along with a code so that I can understand better.

7th Feb 2020, 5:05 PM
Divyansh Upadhyay
Divyansh Upadhyay - avatar
4 Answers
+ 2
A clickable hyperlink? Which gui framework? To deal with an url you can use URL class from the java.net package, see https://docs.oracle.com/javase/8/docs/api/java/net/URL.html
7th Feb 2020, 5:26 PM
Tashi N
Tashi N - avatar
+ 1
Heya you may follow this code example on how to open a URL using java.net base framework. It does not display a clickable link since, as pointed before knowing what GUI framework is used would be necessary. however it will show you how to open one and get the content which you may them use accordingly. https://code.sololearn.com/c56fdRRwxq0w/?ref=app
7th Feb 2020, 5:56 PM
Florent
Florent - avatar
+ 1
Uh..... sorry guys, but I'm still in 8th grade and don't get what you all are saying(btw thanks Tashi N for that link)
8th Feb 2020, 1:32 PM
Divyansh Upadhyay
Divyansh Upadhyay - avatar
0
Do you ask how share code from playground eg in discussion with link ?
7th Feb 2020, 7:19 PM
zemiak