0
I’m trying to get JButtonGuardar(panelInserir)
pass user input(local time text) of the JPanelInserir
to the JPanelEventos
(where is Jtable)
At the moment, I am not succeeding, if you have any suggestions I leave to follow the code of where the problem is occurring:
error: Exception in thread "AWT-Eventqueue-0" java.lang.Nullpointerexception at net.ruimendes.Try$8.actionPerformed(Try.java:417)
Code of 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 complete code is at this link
Rui, as much as adding the complete source is sometimes a facilitator to locate the problem, it is also important that you post on the question itself, a [mcve], with a more localized and smaller portion of the problem, it is even easier for people to help you. With giant codes, many discourage.
– user28595
Hint, try to debug your code and locate the source of the error (or as close as you can identify). Your code has more than 200 lines, imagine the work it takes to analyze a code like this.
– user28595
I have already put the part corresponding to the respective button
– Rui Mendes
What error does it give? Add to the question what problems you are having, error messages that appear.
– user28595