6
In a class that extends JFrame
, I have some calls on the builder, 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 highlighting some passages with the message Call for replaceable method in the constructor, as can be seen in the print below:
Code does not generate errors, normally runs without any kind of problem.
What does this warning message mean? Ignoring it may bring some problem in the application?
The function he claims is a virtual method?
– Rodrigo Guiotti
@Rodrigoguiotti do not know this concept of virtual method in java, I can’t tell you that :/
– user28595
If the method is not static, private or final, it can be replaced by another through inheritance and the class it inherits from Listdeoficiosui could change the behavior of its constructor.
– Rodrigo Guiotti
@Rodrigoguiotti no class inherits
ListaDeOficiosUI
, it is she who inheritsJFrame
, as it is a canvas. But as a daughter class can override the constructor of the upper class?– user28595