Defined the components for instantiating a window.
Set a loop to run every second in another thread.