String hostName = ""; try { InetAddress myAddr = InetAddress.getLocalHost(); hostName = myAddr.getHostName(); } catch (Exception e) { } listenerId = CSMART_LISTENER + hostName + "-" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
  public CSMART() {    setTitle("CSMART");    csmart = this;    createLog();    // Write initial CSMART info to the log file    if (log.isShoutEnabled()) {      log.shout(writeDebug());    }    String hostName = "";    try {      InetAddress myAddr = InetAddress.getLocalHost();      hostName = myAddr.getHostName();    } catch (Exception e) {    }    listenerId = CSMART_LISTENER + hostName + "-" +      new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());    resultDir = initResultDir();    organizer = new Organizer(this);    initDisplay();    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);    // if user closes this window, quit    addWindowListener(new WindowAdapter() {      public void windowClosing(WindowEvent e) {        if(!CSMART.this.getGlassPane().isVisible()) {          exit();        }      }    });    NamedFrame.getNamedFrame().addObserver(myFrameObserver);    pack();    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();    int w = getWidth();    int h = getHeight();    setSize(w, h);    setLocation((screenSize.width - w)/2, (screenSize.height - h)/2);    setVisible(true);  }