File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes (SWT/JFace)Questions about pop-up tooltip in treeviewer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "(SWT/JFace)Questions about pop-up tooltip in treeviewer " Watch "(SWT/JFace)Questions about pop-up tooltip in treeviewer " New topic

(SWT/JFace)Questions about pop-up tooltip in treeviewer

Wang Zhe

Joined: Oct 20, 2010
Posts: 1
I want to implement the following functionality in a treeviewer.

1. When user select a tree item, I want that a small frame like a toolbar can be pop-up and user can click button inside to switch to differenct editors or viewers.

2. When mouse move to a tree item, I want that a tooltip window is pop-up which should be same as the help pop-up windows in java code editor. User can focus on this window and resize it if it is small and the window should be closed when the focus lost.

I have no idea how to implement them. I need a help.

Many thanks.
Andrey Kozhanov
Ranch Hand

Joined: Mar 12, 2010
Posts: 79
I would try to bind MouseListener and MouseMotionListener to the tree and for tooltip windows would try to use JFrame with setUndecorated(true).
Rob Spoor

Joined: Oct 27, 2005
Posts: 19718

Andey, you probably missed the SWT / JFace part. That means Swing classes are out of the question.

The idea of mouse listeners is good though, I'm sure these are available in SWT / JFace as well. For the tree there are also probably selection listeners you can use.

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: (SWT/JFace)Questions about pop-up tooltip in treeviewer