user3455810
user3455810

Reputation: 99

Hide overflow on javafx node?

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

Answers (1)

Someone
Someone

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

Related Questions