title: Want to display date in a label
body: <p>Can you please help me with this codes, I am trying to show the current date in a label, but am using 3 different class, ie, the main class(AppStart), the class which I create the label in ad it will display the label in the frame, thus the (Swing1) and then the date class it self (DateLabel). The code is shown below:</p>
  
  <pre><code>public DateLabel()
  {
      Date today = new Date();
  
      //Date format
      DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US);
      String strDate = df.format(today);
       setText( strDate);
  
  
  }
  }
  
  import java.awt.*;//used for Gui Developement
  import java.util.*;
  import java.text.*;
  import javax.swing.*;//Used for GUI development
  
  public class Swing1 extends JFrame
  {
  
  JLabel lblWelcome;
  DateLabel myDate;
  Swing1()
  {
      JFrame myJF = new JFrame();
      myJF.setTitle("CBT Tutorial");
  
      //JLabel Stuff
      myDate = new DateLabel();
  
      Container c = getContentPane();
      c.add(myDate, BorderLayout.NORTH);
  
  
      myJF.setSize(300,300);
      myJF.show();
  
  }
  
  }
  
  
  public class AppStart {
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) 
  {
     new Swing1();
  }
  }
  </code></pre>