title: Changing width of GridLayout elements
body: <p>I want to change each buttons width but it's not working (i'am new in swing)
  <a href="https://i.stack.imgur.com/utu3a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/utu3a.png" alt="enter image description here"></a></p>
  
  <pre><code>    Panel = new JPanel();
      gl = new GridLayout(2, 1);
      Panel.setLayout(gl);
      add(Panel, BorderLayout.EAST);
  
      Up= new JButton("Btn1");
      Up.addActionListener(this);
      Up.setPreferredSize(new Dimension(200,150));
      Panel.add(Up);
  
      Down = new JButton("Btn2");
      Down.addActionListener(this);
      Down.setPreferredSize(new Dimension(200,300));
      Panel.add(Down);
  </code></pre>