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!

Was it helpful?

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));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top