How to add link in applet?

A

Andrew Thompson

JTL.zheng said:
how to add text link in applet or java app?

A link-like component can be made by adding a
MouseListener to a (J)Label.

In an application (or applet) launched using Java
web start (JWS), the BasicService.showDocument(URL) *
method can be used to open the user's default browser,
pointing to the URL.

* e.g. <http://www.physci.org/jws/> (see the 'BasicService'
example at the top.)

If the app. is not being launched using web start,
the options include.
1) For an applet, the AppletContext.showDocument().
But note that browsers do not have to implement it,
and there is no feedback.
2) For an application or signed applet, BrowserLauncher2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top