title: Show ScrollBars in FlowLayout only when necessary
body: <p>I will rephrase my question:**</p>
  
  <p>How to prevent Java ScrollBar from being enabled in FlowLayout when there is enough space to show all items by warping them. </p>
  
  <p><img src="https://i.stack.imgur.com/ZJHc0.jpg" alt="example">**</p>
  
  <p>Here a screenshot of what I am trying to achieve:</p>
  
  <p>Note that scrollbar is disabled when it is not necessary.
  <img src="https://i.stack.imgur.com/PxzUt.png" alt="enter image description here"></p>
  
  <p>And when you resize the window scrollbar should appear if some items are out the viewplane
  <img src="https://i.stack.imgur.com/hL1NI.png" alt="enter image description here"></p>
  
  <p>P.S. I am aware of things called documentation and web.</p>