문제

I have a TreeViewer in my view. Whenever I press a button (say s), the viewer selects the first item in the tree starting with this letter (say stackoverflow). Is there a way to disable this behaviour?

Thank you.

도움이 되었습니까?

해결책

Restricting all key events on Tree looks promising but you would loose navigating the tree structure and expand/collapse on tree node and all other functionality.

tree.addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent e) {
         e.doit = false;
      }
    });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top