I am doing a program and I need that a JFrame change their components according to one seleccion in a main JFrame, I tried to do so:
public void agregarPanelSegunPrueba(FrmBoleto frm)
{
//this panel is a JPanel make with the graphical editor in netbeans
PnlPruebaDCExesoVelocidad pnl = new PnlPruebaDCExesoVelocidad();
pnl.repaint();
pnl.revalidate();
frm.getContentPane().remove(frm.getPnlPruebasDistanciaTiempo());
frm.getContentPane().add(pnl);
frm.pack();
frm.setVisible(true);
}
somebody know which is wrong here. Thanks in advance.