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.
ツリーと、そのノードの 1 つへの TreePath があります。このノードをプログラムで選択するにはどうすればよいですか? JTree オブジェクトの setSelectionPath だけで機能しますか?
はい。Java ドキュメントから
パスのいずれかのコンポーネントが非表示 (折りたたまれたノードの下) で、getExpandsSelectedPaths が true の場合、それは公開されます (表示可能になります)。