Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

How to add link in applet?

Thread view: 
JTL.zheng - 11 Jun 2007 15:43 GMT
how to add text link in applet or java app?

Thank you in advance.
Andrew Thompson - 11 Jun 2007 16:26 GMT
>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.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Real Gagnon - 12 Jun 2007 03:20 GMT
"JTL.zheng" <jtl.zheng@gmail.com> wrote in news:1181573021.900980.292250
@j4g2000prf.googlegroups.com:

> how to add text link in applet or java app?

For AWT Applet, try my URLLabel component.

http://www.rgagnon.com/javadetails/java-0273.html

Bye.

Signature

Real Gagnon  from  Quebec, Canada
* Java, Javascript, VBScript and PowerBuilder code snippets
* http://www.rgagnon.com/howto.html
* http://www.rgagnon.com/bigindex.html

JTL.zheng - 12 Jun 2007 16:51 GMT
Thanks to all of you.
It works..: )


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.