private synchronized void showWindow()

in src/main/java/org/apache/sling/reqanalyzer/impl/RequestAnalyzerWebConsole.java [182:208]


    private synchronized void showWindow() throws ServletException, IOException {
        if (this.frame == null) {
            final File toAnalyze = this.getLogFileCopy();

            final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            MainFrame frame = new MainFrame(toAnalyze, Integer.MAX_VALUE, screenSize);

            // exit the application if the main frame is closed
            frame.addWindowListener(new WindowAdapter() {
                @Override
                public void windowClosing(WindowEvent e) {
                    // remove the tmp file we showed
                    if (toAnalyze.exists()) {
                        toAnalyze.delete();
                    }
                    // clear the window reference
                    RequestAnalyzerWebConsole.this.frame = null;
                }
            });

            this.frame = frame;
        }

        // make sure the window is visible, try to bring to the front
        this.frame.setVisible(true);
        this.frame.toFront();
    }