Call external JInternalFrame toFront()

57 Views Asked by At

I need the JInternalFrame that call through a menu / button to always be placed in front of the screen and block the previous ones. I can not do it and I think it is a mistake in the structure of my application. Try in every possible way, I must have some misconception.

Calls, like :

    final Estadisticas frameEstadisticas = new Estadisticas();
    JMenuItem mntmEstadisticas = new JMenuItem("Estadisticas");
    mntmEstadisticas.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            if (!frameEstadisticas.isVisible()) {
                contentPane.add(frameEstadisticas);
                frameEstadisticas.setVisible(true);
            }
            else {
                JOptionPane.showMessageDialog(contentPane, "Ya tiene esa aplicacion abierta", "Error Aplicacion",JOptionPane.YES_NO_OPTION);
            }
        }
    });

But the result is like this:

1: JInternalFrame "Agregar Alumno"
2: JInternalFrame "Estadisticas"

"Estadisticas" should be in front.

Reference



Sorry for my english.

0

There are 0 best solutions below