title: How to set size of swing components
body: <p>I want to customize the height and width of the JTextField objects. I have tried with the setSize method, passing width and height as dimensions and as int as well. But none of them seems to work. Am I missing something, like some mandatory method call on the panel or something so that the size customization would be effective? Please help. Thanks in advance.</p>
  
  <p>EDIT: Here is a bit of the code:</p>
  
  <pre><code>public class WestPanel extends JPanel{
  private JLabel dateL;
  private JTextField date;
  public WestPanel(){
  setBackground(Color.white);
  setLayout(new GridLayout(1,2,0,0));
  dateL=new JLabel("Date: ");
  date=new JTextField("dd/mm/yyyy");
  date.setSize(60,10);
  add(dateL);
  add(date);
  //....remaining code....//
  </code></pre>