title: Java Swing Panel collapse into drop down on resize
body: <p>I am working on ribbons using Java Swing technology. I am not using the already made framework called Flamingo (it's not giving the style I want), rather I am implementing it via the netbeans swing drag and drop. I want to make the panels collapse into drop down when the window is resized.</p>
  
  <p>Like if we resized the window to be very small, we will have 3 dropdowns: File, Preferences and Help. Each drop down gives the elements in each section.</p>
  
  <p>Any ideas how to achieve this?<a href="https://i.stack.imgur.com/gt9QZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gt9QZ.png" alt="enter image description here"></a></p>