title: Java GUI specifying width of a textField
body: <p>I have a BorderLayout with layouts in the North, West and Center components. Here is my problem: I have a textField in my Center component and it extends the entire width of the it's parent layout. </p>
  
  <p>It looks something like this...</p>
  
  <pre><code>===============================================================================
  |                                                                             |
  |                                NORTH                                        |
  ===============================================================================
  |    WEST     |                  CENTER                                       |
  |             | textField: __________________________________________________ |
  </code></pre>
  
  <p>I want to make it so the textField does not extend the entire layout but has a fixed size and is centered within the center component.</p>
  
  <p>I have tried setting the preferredSize but had no luck. Code below...</p>
  
  <pre><code>  rText = new JTextField("1000"); 
    rText.setPreferredSize(new Dimension(20, 10)); 
  </code></pre>