How to show some text when you hover over a text in a Java GUI?

Hi,
I ma working on a UI and I try to create a feature that will help me to view some text when I hover over some text.

I currently can create the rest of the view except this hover over feature.

Can you please help me how to create this feature in Java?

The example view is in the attachment.

Thanks,
example-view.png
TolgarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TolgarAuthor Commented:
I use tooltip but this time time I need to populate the text in another place. In the example that I sent, the information that I want to see is on the right handside of the window.

How can I do that?
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Since you haven't posted code (and since I don't really do SWT) here is just a brief pseudocode outline of what to do. You can work out how to integrate this into your code...
Tree tree;    // Assume a Tree object gets created somewhere and is assigned to this "tree" variable

tree.addMouseTrackListener(new MouseTrackAdapter() {
    public void mouseHover(MouseEvent e) {
        TreeItem treeItem = tree.getItem(new Point(e.x, e.y));
         // you can now populate the area to the right of screen with details based on "treeItem"
         //    which will be the item that is hovered over
    }
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.