private void openFile() {
    FileOpenDialog dialog = new FileOpenDialog(frame);
    dialog.setVisible(true);
    final File file = dialog.getFile();
    final Date startTime = dialog.getStartTime();
    final Date endTime = dialog.getEndTime();
    dialog.dispose();

    boolean traceRunning = tracer.isRunning();
    if (traceRunning) tracer.stop();

    if (file != null) {
      try {
        LogFile logFile = new LogFile(file, dataDictionary);
        ArrayList messages = logFile.parseMessages(progressBar, startTime, endTime);
        currentModel = new MessagesTableModel(dataDictionary, logFile);
        currentTable = new MessagesTable(currentModel);
        currentTable.addListSelectionListener(this);
        currentTable.addMouseListener(this);
        JScrollPane component = new JScrollPane(currentTable);
        upperTabbedPane.add(file.getName(), component);
        upperTabbedPane.setSelectedComponent(component);
        currentModel.setMessages(messages, progressBar);
        menuBar.reset();
        menuBar.setFileOpen(true);
      } catch (CancelException e) {
        closeFile();
      } catch (FileNotFoundException e) {
        System.out.println(e);
      } catch (IOException e) {
        System.out.println(e);
      }
    }

    if (traceRunning) tracer.start();
  }
 private void closeFile() {
   upperTabbedPane.remove(upperTabbedPane.getSelectedComponent());
   menuBar.setFileOpen(upperTabbedPane.getComponentCount() > 0);
   System.gc();
 }