Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 398575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:45:43+00:00 2026-05-12T16:45:43+00:00

I have a custom swing component that is implemented similar to a JTree. It

  • 0

I have a custom swing component that is implemented similar to a JTree. It has a ComponentUI that renders an object list using a CellRenderer. The tooltip now correctly shows for each rendered cell, however it doesn’t track the mouse as I would like. For instance, if I have boxes layed out like this;

 [ box A ]    [ box B ]   [ box C ]   [ box D ]

If i drag the mouse across these boxes I will see the tooltip for box A where the mouse crosses the box A boundary. As I continue to move the mouse the tooltip will not track the pointer. When I leave the box the tooltip will appropriately disappear. When i cross box B the same thing happens.

My guess is that the tooltip is only updating the view when the contents of getToolTipText(MouseEvent event) change. The behavior I would like is to have the tooltip track the pointer position regardless of the contents returned by getToolTipText. A quick hack is to add and remove an empty space based on an even/odd number of calls to the method. This works, but bleh, it can’t be the way I am supposed to do it.

I’m looking for a graceful non-hack way of solving this problem. I’m hoping someone knows of some arcane flag somewhere that forces the tooltip to follow the mouse regardless of mouse content.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:45:43+00:00Added an answer on May 12, 2026 at 4:45 pm

    Override getToolTipLocation in your cell renderer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test that exercises a custom Swing component using java.awt.Robot. I'd like
I have custom event that has several different subscribers who will all use the
I have custom component that I can place in my layout file (XML) for
I'm writing a custom swing component (something completely new, but think JTree or JList).
I have java swing chess application. Cursor has custom view - rectangle, sized to
I'm creating some custom Swing components that I'd like to have fade from one
I have a custom Swing component called NavigationLink which extends JLabel and implements a
I have a JTable that is populated using a custom TableModel I created. I
I have a custom JTree implementation that implemts convertValueToText . This implementation depends on
I have custom classes that I currently instantiate within App.xaml as resources. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.