2

I'm working on a component resize from several weeks. I'm writing here because I don't have idea how to solve this issue.

I created example application which holds several TabPanes into one big BorderPane. I want to resize the size of the component using mouse drag and drop. The TabPane which is located at the center of the border can be resized with mouse drag and drop successfully. Now comes the big problem. In JavaFX 8 the component situated on the right side and below the resized component are pushed behind the visible area of the stage. I want to shrink them automatically or expand them when I resize the component.

Simply download the example and build it with JavaFX 8. When the application is loaded move the cursor at the border of the center stage and drag it with the mouse. The near components will be pushed. I would like to prevent moving the near components. I would like to shrink their size.

Can you help me with this big issue?

Example code: http://www.4shared.com/zip/VPrDH8cp/ResizeTest.html Second link: http://rapidshare.com/files/3352955703/ResizeTest.zip

1
  • + I'm also interested how this can be solved. I also face similar issue. Commented Aug 26, 2013 at 7:21

1 Answer 1

1

Try using SplitPane components instead. They already have built-in support for drag-resizing and it will be easy emulate the border layout with a couple of horizontal and vertical splits.

If you have to stick to BorderPane you can use Scenic view to analyse the scene graph. Use it to look at the min/pref/max sizes of the containers and the elements you are trying to resize - maybe they have a minimum size set.

Also your drag resizing code should take the minimum and maximum sizes of the center and border elements into account. Stop the resizing once an element reaced its minimum size (With a SplitPane you get this for free)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.