Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
実装します
@Override public boolean dispatchKeyEvent(KeyEvent e)
私のjscrollpaneで。 私が評価しているとき
e.getSource()
JScrollPaneの下にあるjtableを取得します。
それが自分の階層にあることをどうやって知ることができますか? (私は他のjscrollpane関数を呼び出して、キーイベントを渡しますが、再帰は必要ありません)
これをお探しですか?:
SwingUtilities.getAncestorOfClass(JScrollPane.class, jtable);
または、特定のインスタンスを確認する場合:
SwingUtilities.isDescendingFrom(jtable, aParentOfJTable);
そうでなければ、私はあなたの質問を理解していません。