In a class that extends JFrame
, I have some calls in the constructor, as can be seen below:
public ListaDeOficiosUI() {
try {
this.oficioController = new OficioController();
this.initComponents();
//o alerta é exibido nas 3 chamadas de métodos
// seguintes, todos da classe JFrame
this.setTitle(GerOficiosUI.TITULO + " - Lista de Oficios");
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.addWindowListener(
new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
GerOficiosUI x = new GerOficiosUI();
x.setLocationRelativeTo(null);
x.setVisible(true);
}
@Override
public void windowOpened(WindowEvent e) {
requestFocus();
}
});
this.setRowSorter();
} catch (ExcecaoErroIO ex) {
PrintMessageUI.exibirError(this.getInstance(), ex.getMessage());
System.exit(0);
}
}
However, netbeans is pointing out some snippets of the message Replaceable method call in the constructor , as can be seen in the print below:
The code does not generate errors, it runs normally without any problems.
What does this alert message mean? Can ignoring it cause some problem in the application?