title: TextField size is not increasing in GridBagLayout
body: <p>I am trying to design a simple interface with <code>JFrame</code>, <code>JPanel</code>, <code>JButton</code>, <code>JLabel</code>, <code>JTextField</code> and <code>JPasswordField</code> using <code>GridBagLayout</code> and <code>GridBagConstraints</code>. Also if anyone tell me how can I span textfield in 2 columns when I there are only 2 controls are available.</p>
  
  <p>See the output I am getting</p>
  
  <p><img src="https://i.stack.imgur.com/PobZG.jpg" alt="enter image description here"></p>
  
  <p>Look TextField and PasswordField how they are I am trying to get bigger size but failed see the code I used.</p>
  
  <p>All the required classes are imported</p>
  
  <pre><code>public class login extends JFrame{
  private JPanel jPanelC,jPanelE,jPanelW,jPanelN,jPanelS;
  private JLabel jlabel1,jlabel2,jlabel3;
  private JTextField jid;
  private JPasswordField jpass;
  private JButton jbutton1;
  Border empty = BorderFactory.createEmptyBorder();
  
  public login()
  {
      jPanelC=new JPanel();
      jlabel1=new JLabel("User ID");
      jlabel2=new JLabel("Password");
      jlabel3=new JLabel("Password");
      jid=new JTextField(15);
      jid.setPreferredSize(new Dimension(100, 100));
      jpass=new JPasswordField(15);
      jpass.setPreferredSize(new Dimension(100, 100));
      jbutton1=new JButton("Login");
      jbutton1.setPreferredSize(new Dimension(100, 100));
  
      jPanelC.setBackground(new java.awt.Color(204, 204, 255));
      jPanelC.setBorder(empty);
      int eb=5;
      jPanelC.setBorder(BorderFactory.createCompoundBorder(
      BorderFactory.createEmptyBorder(eb, eb, eb, eb), // outer border
      BorderFactory.createLoweredBevelBorder()));      // inner border
      jPanelC.setSize(300, 150);
  
      jPanelC.setLayout(new GridBagLayout());
      GridBagConstraints c = new GridBagConstraints();
  
      c.fill = GridBagConstraints.HORIZONTAL;
      c.gridx = 0;
      c.gridy = 0;
      jPanelC.add(jlabel1,c);
  
      c.fill = GridBagConstraints.HORIZONTAL;
      c.gridx = 2;
      c.gridy = 0;
      jPanelC.add(jid,c);
  
      c.fill = GridBagConstraints.HORIZONTAL;
      c.gridx = 0;
      c.gridy = 1;
      jPanelC.add(jlabel2,c);
  
      c.fill = GridBagConstraints.HORIZONTAL;
      c.gridx = 2;
      c.gridy = 1;
      jPanelC.add(jpass,c);
  
      c.fill = GridBagConstraints.HORIZONTAL; 
      c.gridx = 0;
      c.gridy = 2;      
      c.gridheight=1;
      c.gridwidth = 2;
  
     jPanelC.add(jbutton1,c);
  
      jPanelE=new JPanel();
      jPanelW=new JPanel();
      jPanelN=new JPanel();
      jPanelS=new JPanel();
      add(jPanelE,BorderLayout.EAST);
      add(jPanelW,BorderLayout.WEST);
      add(jPanelN,BorderLayout.NORTH);
      add(jPanelS,BorderLayout.SOUTH);       
      add(jPanelC,BorderLayout.CENTER);
  
      setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
      setTitle("Login Console");
      setBackground(new java.awt.Color(255, 255, 255));
      setSize(400, 300);
      this.setVisible(true);       
  }
  public static void main(String[] args)
  {
      login log=new login();
  }
  </code></pre>
  
  <p>After adding c.weightx=1; Final output</p>
  
  <p><img src="https://i.stack.imgur.com/a3fAP.jpg" alt="enter image description here"></p>