I am tryin to make a software in which when clicked on the subnode of a jtree, detecting which node is sel开发者_StackOverflow社区ected, want to display respective message.
You will need to add a TreeSelectionListener to the model containing your nodes. The event arguments contain data for the node(s) selected. Here is some example documentation.
精彩评论