0

I want to display different tooltip text for each element in SWT combo widget. I found two similar questions but none of them seems to solve the question.

1) Set tooltip text for each element in an SWT Combo widget
2) how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

Combo combo = new Combo(container, SWT.READ_ONLY | SWT.BORDER);
combo.setBounds(278, 298, 135, 20);
combo.add("first");
combo.add("second");
combo.add("third");
combo.add("fourth");
combo.addMouseTrackListener(new MouseTrackAdapter() {
    @Override
    public void mouseHover(MouseEvent e) {
        // TODO Auto-generated method stub
        super.mouseHover(e);
        // logic which will get me a hovered combo item without 
        // selecting any particular item.
    }
});

In the above code when user hover on comboitem first then I want to display 1st in tooltip, for second display 2nd in tooltip, likewise..
Please help me with this problem.

Community
  • 1
  • 1
Napster
  • 95
  • 8
  • 1
    post some code, please – Javi Mollá Feb 24 '15 at 12:32
  • When I hover on drop down part of the combobox then I want to display tooltip. For example I have three value in combo box **"a", "b", "c"** and when I hover on **"a"**, I want to display let's say **"a's tooltip"** in tooltip. – Napster Feb 24 '15 at 12:37
  • edit your post to update your question. – gp_sflover Feb 24 '15 at 12:42
  • This may vary by platform but on my Mac there are no mouse events fired when the Combo drop down is open so this can't be done. – greg-449 Feb 24 '15 at 13:20
  • In window also there isn't any event fired when the combo drop down is open. I tried every listener. So is this functionality not possible to implement? – Napster Feb 24 '15 at 14:36

0 Answers0