Date de chargement dans le component swing jtextfield

J'ai eu quelques problèmes de chargement d'une date dans un JTextField. Quelles erreurs ai-je faire?

public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewApplication().setVisible(true);
}
});
}
//---------------------------------------------------------------------------
public class FormatedDate {
Date dNow = new Date();
SimpleDateFormat ft = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
String reportDate = ft.format(dNow);
public void LoadDate() {
jTextField3.setText(reportDate);
System.out.println("Current Date: " + reportDate);
}
}
//--------------------------------------------------------------------------- 
  • Veuillez expliquer quels sont les problèmes que vous avez rencontré.
  • Je ne sais pas comment faire pour charger la date actuelle dans le component swing jtextfield. Je suis foiré avec statiques et non statiques.
  • Vous devez d'abord créer et ajouter un champ de texte à l'image avant de pouvoir afficher une valeur. Publier vos SSCCE qui affiche un cadre avec un champ de texte. Si vous ne savez pas ce qu'est un SSCCE est la recherche sur le forum du web. Le code que vous avez posté n'aide pas.
InformationsquelleAutor Vilius | 2013-04-29