title: JTable inside a JPanel inside a JOptionPane won't resize as wanted
body: <p>I have two <code>JTable</code> objects inside a <code>JPanel</code> with <code>GridLayout</code>. I put them in a <code>JOptionPane</code> and I show them as an <code>OK_CANCEL</code> popup. I also put a <code>JScrollPane</code> on both tables.</p>
  
  <p>However, the <code>JOptionPane</code>'s size is enormous. I have tried setting different table, scroll pane and jpanel sizes with:</p>
  
  <pre><code>table.setSize(int w, int h)
  jpanel.setSize(int w, int h)
  jscrollpane.setSize(int w, int h)
  </code></pre>
  
  <p>but none of those would result in a smaller <code>JOptionPane</code> (or table).</p>
  
  <p>This is how it looks, I use 1366*768 as resolution. None of the mentioned above would make any difference</p>
  
  <p><img src="https://i.stack.imgur.com/Eq82A.png" alt="This is how it looks"> </p>
  
  <pre><code>private void showEditItemSuppliersDialog()
      {
      String newItemSupplierTables [] = { "#", "Name", "" };
          JPanel panel = new JPanel(new GridLayout(0, 2, 5, 5));
  
          /* table 1 */
          allItemsEditItemSuppliersTableModel = new DefaultTableModel(null, newItemSupplierTables);
  
          allItemsEditItemSuppliersTable = new JTable(allItemsEditItemSuppliersTableModel);
          allItemsEditItemSuppliersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  
          JScrollPane allItemsEditItemSuppliersTableScrollPane = new JScrollPane();
          allItemsEditItemSuppliersTableScrollPane.setViewportView(allItemsEditItemSuppliersTable);
          /* table 1 end */
  
          /* table 2 */
          allItemsEditItemSuppliersAllTableModel = new DefaultTableModel(null, newItemSupplierTables);
  
          allItemsEditItemSuppliersAllTable = new JTable(allItemsEditItemSuppliersAllTableModel);
          allItemsEditItemSuppliersAllTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  
          JScrollPane allItemsEditItemSuppliersAllTableScrollPane = new JScrollPane();
          allItemsEditItemSuppliersAllTableScrollPane.setViewportView(allItemsEditItemSuppliersAllTable);
          /* table 2 end*/
  
          panel.add(allItemsEditItemSuppliersTableScrollPane);
          panel.add(allItemsEditItemSuppliersAllTableScrollPane);
  
          int option = JOptionPane.showConfirmDialog(null, panel, "Edit", JOptionPane.OK_CANCEL_OPTION);
  
          if (option == JOptionPane.YES_OPTION)
          {   
              System.out.println("Pressed OK");
          }
      }
  </code></pre>