title: My JTable does not expand to full width of panel it is in
body: <p>how can I make my JTable use the full available with of the parent panel? I've tried to work with setSize or setPreferredSize but that didn't work. The latter actually produced a very tiny version of the table.</p>
  
  <pre><code>JPanel panel = new JPanel(new GridBagLayout());
      GridBagConstraints constraints = new GridBagConstraints();
      constraints.gridx = 0;
      constraints.gridy = 0;
      constraints.insets = new Insets(0, 0, 25, 15); 
  String[] columnNames = {"A", "B", "C", "D", "E"};
          Object[][] data = new Object[20][columnNames.length];
          for( int i = 0; i &lt; 20; i++ ){
              data[i] = new Object[]{"Some other stuff that is long", "K", "1234567891011121314", "R", "T"};
          }
  
          JTable skillTable = new JTable(data, columnNames);
          skillTable.setFillsViewportHeight(true );
          JScrollPane scrollTable = new JScrollPane(skillTable);
          constraints.fill = constraints.HORIZONTAL;
          panel.add(scrollTable, constraints);
  </code></pre>
  
  <p>This is what it looks like: <a href="http://i.stack.imgur.com/P4b6A.png" rel="nofollow">http://i.stack.imgur.com/P4b6A.png</a></p>