How can i hide the contents on pane?

202 Views Asked by At

I am developing a javafx sketching application. I have created a borderpane and dividing it into three regions:

  1. The first region(top region): for menubar.
  2. The second region(center region): is used as a canvas.
  3. The third region(bottom region): is created to represent toolbar items.

The toolbar includes a group of pens and other items. it has created using pane class.The problem in my application is when I draw on the canvas, the drawn line can overcome its boundary when I drag on mouse, and drawn on toolbar.

So is there another pane (for toolbar items) that is used to hide these drawn lines?

Part of the code:

public Paint(){
     p1 = new BorderPane();
     toolsBar = new Pane();
     freePane = new Pane();
     p1.setBottom(toolsBar);
     p1.setCenter(freePane);
    
   
     toolsBar.setCursor(Cursor.HAND);
     toolsBar.setId("toolsBar");
}

Circle can be drawn in toolbar pane:

enter image description here

0

There are 0 best solutions below