# ResizableBorder for two adjacent components?

**URL:** <https://forum.juce.com/t/resizableborder-for-two-adjacent-components/56966>\
**Category:** General JUCE discussion\
**Created:** [July 9, 2023, 8:19am UTC](https://forum.juce.com/t/resizableborder-for-two-adjacent-components/56966 "2023-07-09T08:19:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![StefanS](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@StefanS](https://forum.juce.com/u/StefanS)\
**Post date:** [July 9, 2023, 8:19am UTC](https://forum.juce.com/t/resizableborder-for-two-adjacent-components/56966/1 "2023-07-09T08:19:20Z")

</div>

Hi,

I need some kind of ResizableBorder between two adjacent components so when I drag the border, it enlarges the one component and automatically shrinks the other by the same amount.

Before building my own, maybe someone is aware of some class in Juce?

Thanks  
Stefan

---

<div class="post-metadata">

**Author:** ![ibisum](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ibisum/32/21288_2.png) [@ibisum](https://forum.juce.com/u/ibisum)\
**Post date:** [July 9, 2023, 10:52am UTC](https://forum.juce.com/t/resizableborder-for-two-adjacent-components/56966/2 "2023-07-09T10:52:46Z")

</div>

Maybe I’ve misunderstood your needs, but it seems there are a couple of ways to accomplish your spec. In the DemoRunner FontsDemo.h sources, there is an example of using a verticalDividerBar (StretchableLayoutResizerBar) to separate the boundaries of different components, note the resize() methods’ delegation of layout to verticalLayout (StretchableLayoutManager) … which may, or may not be what you want, i.e. see also FlexBoxDemo.h which provides a much more sophisticated component layout mechanism.

---

<div class="post-metadata">

**Author:** ![StefanS](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@StefanS](https://forum.juce.com/u/StefanS)\
**Post date:** [July 9, 2023, 11:12am UTC](https://forum.juce.com/t/resizableborder-for-two-adjacent-components/56966/3 "2023-07-09T11:12:30Z")

</div>

`StretchableLayoutResizerBar` and `StretchableLayoutManager` was exactly what I was looking for!! I’ve searched through the whole Demo Runner and obviously overlooked that thing in the Fonts Demo.

Thanks so much.

cheers  
Stefan

---

<div class="post-metadata">

**Author:** ![ibisum](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ibisum/32/21288_2.png) [@ibisum](https://forum.juce.com/u/ibisum)\
**Post date:** [July 9, 2023, 11:23am UTC](https://forum.juce.com/t/resizableborder-for-two-adjacent-components/56966/4 "2023-07-09T11:23:40Z")

</div>

No worries, happy to help …
