Normalemnt, quand je mets ce code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| // Create a date picker
DatePicker datePicker = new DatePicker();
final Label text = new Label();
// Set the value in the text box when the user selects a date
datePicker.addValueChangeHandler(new ValueChangeHandler() {
public void onValueChange(ValueChangeEvent event) {
Date date = event.getValue();
String dateString = DateTimeFormat.getMediumDateFormat().format(date);
text.setText(dateString);
}
});
// Set the default value
datePicker.setValue(new Date(), true);
// Add the widgets to the page
RootPanel.get().add(text);
RootPanel.get().add(datePicker); |
Il m'indique une erreur sur le type "DatePicker". A ce stade, je dois donc ajouter l'import nécessaire qui est normalemnt celle que tu m'as donné.
Mais quand, je l'ai mis il maffiche ce message :
import com.google.gwt.user.datepicker cannot be resolved
Mon problème ce que j'ai pas compris pourquoi il n'arrive pas à connaître cet import?
Merci.
Partager