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();