title: How to make JTextField as wide as the window
body: <p>I want to make the text automatically as wide as the window. I tried using <code>text.setSize(window.getWidth(),20)</code> and <code>text.setBounds(window.getWidth(),20)</code>, (where text is JTextfield), but the only way that seems to work is: <code>static JTextField text = new JTextField(int numberOfColumns);</code> I'm using GridBag layout.</p>