This question is not specific to B4J. It is a XUI2D question. I've moved it to the games forum.
Check Ilan's First App Example from the examples pack.
There is a panel named PanelForTouch. When the user touches it, there is a check for nearby switches. If none are found then a new ball is created.
The relevant sub is PanelForTouch_Touch and the important code is:
Dim worldpoint As B2Vec2 = X2.ScreenPointToWorld(X, Y)
For Each TouchedBody As X2BodyWrapper In X2.GetBodiesIntersectingWithWorldPoint(worldpoint)