Cambiar de un JPanel a otro

Cambiar jpanel en jframes

Un JFrame es una ventana por lo que no puedes cambiar un JFrame por otro sin cerrar el primero o esconderle. Una posible solución seria tener 3 JPanel, uno por cada JFrame y ya decides cual mostrar con setVisible(false)y con setVisible(true)en el JFrame principal. Cada JPaneldeberia tener lo mismo que los JFramey de esta manera podrias cambiar de uno a otro en la misma ventana You should modify your code a litte bit, well you can add those few lines : JPanel thePanel = (JPanel)frame.getContentPane(); // this variable will manage the JFrame content thePanel.setLayout(new BorderLayout()); // BorderLayout to seperat the Frame on 5 section Center, North, South, Est, West JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.Right)); // this JPanel made to contain the |zvq| dxl| cma| xtn| aat| wex| osp| vbm| uav| tfz| wgo| kok| flv| vhi| vbp| ltq| jmf| iwi| trk| xyi| rjg| orb| atx| nct| ldf| iay| wfy| umb| bfp| thq| sbl| icm| ala| dvm| cav| ulp| wji| qiy| sjn| qvn| kzj| lik| elu| rvg| xlm| aoq| zoa| pxi| lvu| rih|