Reputation: 99
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!
Upvotes: 4
Views: 4129
Reputation: 216
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));
Upvotes: 7