title: set JButton size in gridLayout
body: <p>How to set the size of jbutton in gridlayout? otherwise the button size have lot of width and its not listening setSize or setBounds or setPreferedSize.</p>
  
  <pre><code>    addBut = new JButton("Add");
  
      addBut.addActionListener(this);
      deleteBut = new JButton("Delete");
      deleteBut.addActionListener(this);
      selectionPanel = new JPanel();
      selectionPanel.setLayout(new GridLayout(2,2));
      TitledBorder selectionBorder = new TitledBorder("Options");
      selectionBorder.setTitleColor(Color.BLUE);
      selectionPanel.setBorder(selectionBorder);
      selectionPanel.add(new JLabel("Department Name"));
      selectionPanel.add(new JTextField(deptName));
      selectionPanel.add(addBut);
      selectionPanel.add(deleteBut);
  
      selectionPanel.setPreferredSize(new Dimension(900,100));
  </code></pre>