private void initialize()
    {
        setLayout(new BorderLayout(10, 10));
        setSize(950, 550);

        setTitle("MoruTask");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                try {
                    System.out.println("Saving Models...");
                    Main.saveModels();
                    //Main.saveSettings();
                } catch (FileNotFoundException | FactoryCoderException ex) {
                    Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
        
        formBuildHelper = new FormBuildHelper();
        
        scrollPane = new JScrollPane();
        
        groupList = new GroupList();
        groupList.addListSelectionListener(new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent e) {
                itemUnit selectedValue = (itemUnit) groupList.getSelectedValue();
                TaskFilter.setFilter(selectedValue.getFilter());
                rowsorter.sort();
            }
        });
        taskTable = new TaskTable();
        
        scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollPane.setViewportView(taskTable);
        
        rowsorter = (TableSortController) viewUtils.getInstance().getTaskTable().getRowSorter();

        splitPane = ComponentFactory.createThinJSplitPane(JSplitPane.HORIZONTAL_SPLIT);
        splitPane.setRightComponent(scrollPane);
        splitPane.setLeftComponent(groupList);
        splitPane.setDividerSize(10);
        splitPane.setOneTouchExpandable(true);

        searchField = new JXSearchField("Search");
        searchField.setColumns(20);
        searchField.addKeyListener(new KeyAdapter() {

            @Override
            public void keyPressed(KeyEvent e) {
                if (searchField.getText().length() ==0)
                        rowsorter.setRowFilter(new TaskFilter());
                else
                    rowsorter.setRowFilter(RowFilter.regexFilter(searchField.getText()));
            }
            
});
        searchField.addFocusListener(new FocusAdapter() {

            @Override
            public void focusGained(FocusEvent e) {
                JTextField source = (JTextField) e.getSource();
                if (source.getText().equalsIgnoreCase("Search"))
                {
                    source.setText(null);
                }
            }
            
});
        
        sortComboBox = new JComboBox(new DefaultComboBoxModel<>(TaskSortType.values()));
        sortComboBox.addItemListener(new ItemListener() {

            @Override
            public void itemStateChanged(ItemEvent e) {
                
               if (e.getStateChange() == ItemEvent.SELECTED)
               {
                   //TableSortController rowsorter = (TableSortController) viewUtils.getInstance().getTaskTable().getRowSorter();
                   TaskComparable taskComparable = new TaskComparable();
                   taskComparable.setTypeOfComparison((TaskSortType) sortComboBox.getSelectedItem());
                   
                   viewUtils.getInstance().getTaskTable().resetSortOrder();
                   rowsorter.setComparator(0, taskComparable);
                   viewUtils.getInstance().getTaskTable().setSortOrder(0, SortOrder.DESCENDING);
               } 
            }
        });
        
        addButton = new JButton("Add");
        addButton.addActionListener(new ActionAddTask());
        
        deleteButton = new JButton("Delete");
        deleteButton.addActionListener(new ActionDeleteTask());
    
        
        panel = new JPanel(new FlowLayout(5, 5, 5));
        panel.add(addButton);
        panel.add(deleteButton);
        panel.add(formBuildHelper.appendLabeltoComponent("Sort", sortComboBox, true));
        panel.add(searchField);
        
        add(panel,BorderLayout.PAGE_START);
         add(splitPane,BorderLayout.CENTER);
         //tasksCalendarPanel = new TasksCalendarPanel();
        //add(tasksCalendarPanel,BorderLayout.CENTER);
        //add(groupList,BorderLayout.LINE_START);
        //add(scrollPane,BorderLayout.CENTER);
        
    }