4
Greetings, my friends.
I have a problem in Java.
I am trying to add a "Occurrence" element to a Jlist. This element has 4 elements within it, which I need to maintain. So far so good.
However, the problem appears when I add the said element to the list
The list displays this name in the widget. Why? I would like the name of the occurrence to appear instead of this name.
Here is the occurrence code:
@Override
public void actionPerformed(ActionEvent e) {
//dispose();
Ocorrencia ocorrencia = new Ocorrencia();
ocorrencia.setLocationRelativeTo(null);
ocorrencia.setVisible(true);
ocorrenciasAtivas.modeloOcorrencias.addElement(ocorrencia);
}
Excellent answer. Fast and practical. I replaced the class toString method by returning the name string. Thank you, Pablo!
– Momentanius