Gente, estou tendo problemas na construção da minha interface grafica, eu preencho todos os campos normalmente mas quando chega no campo prazo, eu digito a data e ela simplesmente SOME, não fica ali quando eu saio do campo, fica totalmente vazio, diferente dos outros que quando eu digito fica ali, alguém tem alguma solução por favor?
Eu tentei por o dado data por ultimo e ja salvar pra ver se eu salvava com sucesso mas deu um erro que pode ser uma pista
mas eu não achei nada q podia ser nulo no meu codigo. mandando a lista
package model;
import java.util.Date;
public class Task {
private int id;
private int idProject;
private String name;
private String notes;
private String description;
private boolean isCompleted;
private Date deadline;
private Date createdAt;
private Date updatedAt;
public Task(int id, int idProject, String name, String notes, String description, boolean isCompleted, Date deadline, Date createdAt, Date updatedAt) {
this.id = id;
this.idProject = idProject;
this.name = name;
this.notes = notes;
this.description = description;
this.isCompleted = isCompleted;
this.deadline = deadline;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
public Task(){
this.createdAt = new Date();
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getIdProject() {
return idProject;
}
public void setIdProject(int idProject) {
this.idProject = idProject;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public boolean isIsCompleted() {
return isCompleted;
}
public void setIsCompleted(boolean isCompleted) {
this.isCompleted = isCompleted;
}
public Date getDeadline() {
return deadline;
}
public void setDeadline(Date deadline) {
this.deadline = deadline;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return "Task{" + "id=" + id + ", idProject=" + idProject + ", name=" + name + ", notes=" + notes + ", description=" + description + ", isCompleted=" + isCompleted + ", deadline=" + deadline + ", createdAt=" + createdAt + ", updatedAt=" + updatedAt + '}';
}
package model;
import java.util.Date;
public class Project {
private int id;
private String name;
private String description;
private Date createdAt;
private Date updateAt;
public Project(int id, String name, String description, Date createdAt, Date updateAt) {
this.id = id;
this.name = name;
this.description = description;
this.createdAt = createdAt;
this.updateAt = updateAt;
}
public Project() {
this.createdAt = new Date();
this.updateAt = new Date();
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdateAt() {
return updateAt;
}
public void setUpdateAt(Date updateAt) {
this.updateAt = updateAt;
}
@Override
public String toString() {
return "project{" + "id=" + id + ", name=" + name + ", description=" + description + ", createdAt=" + createdAt + ", updateAt=" + updateAt + '}';
}
private void jPanelToolBarSaveMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
try {
Task task = new Task();
task.setIdProject(3);
task.setName(jTextFieldName.getText());
task.setDescription(jTextAreaDescription.getText());
task.setNotes(jTextAreaNotes.getText());
task.setIsCompleted(false);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date deadline = null;
deadline = dateFormat.parse(jFormattedTextFielddeadline.getText());
task.setDeadline(deadline);
controller.save(task);
JOptionPane.showMessageDialog(rootPane, "Tarefa salva com sucesso");
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, e.getMessage());
}
this.dispose();
}
EU LITERALMENTE, N SEI O QUE FAZER PQ N ACHEI NADA NO MEU CODIGO Q PODE TA NULO, HEELP