title: Dynamic width and fixed height of rows in JPanel
body: <p>I am trying to use Java layout managers (I have no external libraries, and am using Java 7) to create a layout where data is provided in rows, where the rows have a fixed height, but the width fills to fit the window. An example is provided below:</p>
  
  <p><img src="https://i.stack.imgur.com/TALAL.png" alt="Example of layout"></p>
  
  <p>The idea is that I will be adding rows throughout the run of the application, and each row will simply be added to the bottom list. If too many rows are added to the window, then a scroll bar will appear (that bit I have sorted).</p>
  
  <p>My issue so far is that if I use a GridLayout for the main JPanel, it will make the rows fill to the entire window, and just make each row smaller as more rows are added. I want it so that regardless of how many rows are added, the rows height will always remain the same.</p>
  
  <p>Each row consists of two columns that should be the same width. So for this I believe a GridLayout would work nicely, but I'm thinking that I need to add the GridLayout to another panel which essentially represents the entire row.</p>
  
  <p>It is preferable that I use Swing layout managers to achieve the desired layout, but if other suggestions are posed, then I will definitely look into them. As numerous people seem to have found in other questions I've seen, Java's layout managers seem to be a bit lacking in some areas, unfortunately I am unable to tell when it is my knowledge that is lacking, rather than the language itself.</p>