title: How to stop a JTextField from getting re-sized in GridLayout
body: <p>I am creating a GUI with grid layout. I have added the JTextFields, JButtons and everything to it DIRECTLY. For an example, like this,</p>
  
  <pre><code>JButton b1 = new JButton("Hello"):
  JButton b2 = new JButton("Bye");
  JTextField t1 = new JTextField(10);
  JTextField t2 = new JTextField(10);
  
  GridLayout grid = new GridLayout(2,2,2,2);
  
  JPanel panel = new JPanel();
  panel.setLayout(grid);
  panel.add(b1);
  panel.add(t1);
  panel.add(b2);
  panel.add(t2);
  </code></pre>
  
  <p>In here, if the user resizes the window everything appears very large. The only other way I know to prevent these from getting these is adding all of each and everything to seperate JPanel which has FlowLayout. But thats not practical because if there are 20 stuff, there will be 20 JPanels. I tried setting the maximum size, minimum size and all, and they didnt change any. Please help.</p>