I'm trying to get JButtonGuardar(panelInserir)
to pass data entered by the user (local time text) from JPanelInserir
to JPanelEventos
(where is JTable)
At the moment, I am not succeeding, if you have any suggestions, I will leave the following code where the problem is occurring:
error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at net.ruimendes.Tentative $ 8.actionPerformed (Attempt.java:417)
Code where the error is occurring:
JButton btnGuardar = new JButton("Guardar");
btnGuardar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
double hora = Double.parseDouble(textHoraInicio.getText());
String texto = textTexto.getText();
String local = textLocal.getText();
Agendado agen = new Agendado(hora, texto, local);
eventoAtual.adicionaAgendado(agen);
textHoraInicio.setText(String.format("%.2f", eventoAtual.getHora()));
textHoraInicio.setText("");
textTexto.setText("");
textLocal.setText("");
} catch (NumberFormatException e1) {
e1.printStackTrace();
} catch (AgendadoNuloException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
The full code is in this link