public SalesSystemUI(SalesDomainController domainController) {
    this.domainController = domainController;
    this.model = new SalesSystemModel(domainController);

    // Create singleton instances of the tab classes
    historyTab = new HistoryTab(model);
    stockTab = new StockTab(model);
    purchaseTab = new PurchaseTab(domainController, model);

    setTitle("Sales system");

    // set L&F to the nice Windows style
    try {
      UIManager.setLookAndFeel(new WindowsLookAndFeel());

    } catch (UnsupportedLookAndFeelException e1) {
      log.warn(e1.getMessage());
    }

    drawWidgets();

    // size & location
    int width = 600;
    int height = 400;
    setSize(width, height);
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    setLocation((screen.width - width) / 2, (screen.height - height) / 2);

    addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent e) {
    	closeApp();
      }
    });
  }