Compound JTree Node allowing events to pass through to objects underneath

后端 未结 2 785
滥情空心
滥情空心 2021-01-03 09:26

I\'m trying to create a JTree in which some nodes are compound objects containing a JLabel and a JButton. The Node is representing a server and port shown by the JLabel, th

2条回答
  •  孤城傲影
    2021-01-03 09:45

    the node should have 2 parts a label and a button. When the user clicks the label then some detailed information about the node should appear in a different part of the GUI. When the user clicks the button it should result in a browser window opening. ..

    Don't do it that way. Instead, have just the label in the tree. Add the button to the same GUI that displays the 'detailed information about the node'.

提交回复
热议问题