我創建了一個由文本和矩形組成的組件。我把它放在某個特定位置的 AnchorPane 中。我想通過單擊選擇它。我使用 MousePressEvent 但有:GetSource(),我得到了 AnchorPaneGetTarget(),我得到文本或矩形我應該用什么來獲取我的組件? 查看完整描述