Question

I am trying to create a panel inside another panel. The inner one is supposed to be larger than the parrent, but whatever extends beyond the parent's bounds should not be painted. How do i do that?

Note: it is important that the child is larger than the parent, so please note that i can not bind childs dimensions to the parent's ones.

Help!

Était-ce utile?

La solution

Better late than never, you simply have to clip your child node to a Rectangle that will act as a viewport :

childPane.setClip(new Rectangle(400, 277));
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top