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 / GUI / June 2005

Tip: Looking for answers? Try searching our database.

JEditorPane hyperlinks and the right mouse button

Thread view: 
Tara - 08 Jun 2005 19:55 GMT
Hi Group,

Any ideas on how I can determine which buttonw was used to get a hyperlink
callback (hyperlinkUpdate()) from JEditorPane?

I want only the left mouse button to activate the hyperlink, not the right.

Thx,

-Tara
Roland - 08 Jun 2005 21:40 GMT
> Hi Group,
>
[quoted text clipped - 6 lines]
>
> -Tara

The HyperlinkEvent doesn't seem to provide this information. One way I
can think of at this moment, is to add a MouseListener to the
JEditorPane, record the state in the mousePressed and mouseReleased
handlers, and use this state in the HyperLinkListener.
However, I don't know if the ordening of the events might prevent you
from detecting it. For instance, the editor pane might have its own
mouse listener --which detects the mouse press on a hyperlink and fires
hyperlinkUpdate-- *before* your mouse listener has a chance to record
which button was pressed.
Signature

Regards,

Roland de Ruiter
` ___      ___
`/__/ w_/ /__/
/  \ /_/ /  \



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



©2008 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.