The JFrame
PantallaCaptura
first becomes visible and then the container with the JButton
component is added, but as there is no 'refresh' of the GUI then it is not possible to see what is added (unless the JFrame
is re-dimensioned).
What can be done is:
setVisible(true);
add(new LaminaCaptura());
revalidate(); //actualiza el árbol de componentes (GUI) y llama a repaint()
Or on the other hand, simply put components first and then make the JFrame
visible:
add(new LaminaCaptura());
setVisible(true);