source code for the main window and JFrame work