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 / November 2003

Tip: Looking for answers? Try searching our database.

Swing-wide override of JToolTip location

Thread view: 
Leo Breebaart - 05 Nov 2003 14:52 GMT
I am developing a Swing-GUIed program that needs to run on a
Tablet PC. For a right-handed person using the program, the
default location where tooltips pop-up (below and to the right of
the mouse pointer) is exactly wrong, because the user's hand
(which is holding the pen) will be covering the text. Having
tooltips appear up- and leftwards of the component would be much
more useful.

Now I know that I can affect the location of the tooltip for
individual JComponents by overriding getToolTipLocation(), but I
am not looking forward to having to do that for every JComponent
in my program. What I'm really looking for is a Swing-wide
override of the tooltip-positioning that takes place if you
*don't* override getToolTipLocation(), and thus have Swing choose
a left-and-up location by default for *all* the JComponents in
the program, instead of its current down-and-right choice.

Does anybody here know if something like that is even remotely
feasible, and, if so, how I might go about achieving this effect?
Or if it's not possible, if there is perhaps a less painful way
than overriding getToolTipLocation for everything to do something
similar?

Many thanks in advance,

Signature

Leo Breebaart  <leo@lspace.org

Thomas Weidenfeller - 05 Nov 2003 18:28 GMT
> Does anybody here know if something like that is even remotely
> feasible, and, if so, how I might go about achieving this effect?
> Or if it's not possible, if there is perhaps a less painful way
> than overriding getToolTipLocation for everything to do something
> similar?

IIRC the tooltip positioning is hard coded in the ToolTipManager. You
would have to replace the ToolTipManager. I have no idea if this is
possible.

Good luck

/Thomas


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.