Good to make the question less confusing I'll say that I have a jpanel form, two jframe form, jframe1 and jframe2.
In the jframe1 I use this code for flames or insert (I do not know how to express it) the jpanel form with button:
Panel panelD = new Panel();
panelD.setSize(1240,465);
panelD.setLocation(0,0);
PanelLab.removeAll();
PanelLab.add(panelD,BorderLayout.CENTER);
PanelLab.revalidate();
PanelLab.repaint();
This works and the jframe1 shows the jpanel, the problem is that this jpanel has a button with which I want to open the jframe2, but when pressing it nothing happens, I use this code:
private void btnAñadirActionPerformed(java.awt.event.ActionEvent evt) {
frame2 v = new frame2();
v.setVisible(true);
}
I do not know if I did something wrong (PS: I have some sleep).
Sorry for the molestask, I realized I was calling another Panel form that was not, I'm an idiot, sorry to waste your time.