private void addNewCategoryList() {
        list = new JList(model);
        
        //Add a selectionlistener that listens for change in row 
        list.addListSelectionListener(new ListSelectionListener() {
        
            @Override
            public void valueChanged(ListSelectionEvent lse) {
                TODOManager.backend.setSelectedCategory(model.getElementAt(list.getSelectedIndex()).toString());
                TODOManager.backend.viewChange();
            }
        });
        
        //Adds a keylistener as we are deleting items with the delete
        //key
        list.addKeyListener(new KeyListener() {

            @Override
            public void keyTyped(KeyEvent ke) {
                
            }

            @Override
            public void keyPressed(KeyEvent ke) {                
                //You can delete categories using the delete key, a confirm dialog
                //will popup for the user to answer to
                if(ke.getKeyCode() == KeyEvent.VK_DELETE){
                    
                    //You shouldnt be able to delete the category All, appropriate dialog
                    //is shown if you try
                    if(!list.getSelectedValue().equals(TODOManager.backend.getCategoryListModel().getElementAt(0)))
                    {
                        int result = JOptionPane.showConfirmDialog(null, TODOManager.manager.getBundle().getString("catequestion"));
                        if(result == JOptionPane.YES_OPTION && !model.getList().get(list.getSelectedIndex()).getCategoryTitle().equals(TODOManager.manager.getBundle().getString("all"))){
                            TODOManager.backend.deleteCategory((model.getList().get(list.getSelectedIndex())));
                        }
                    }
                    else{
                        JOptionPane.showMessageDialog(null, TODOManager.manager.getBundle().getString("cantDelete"));
                    }
                }
                
                
            }

            @Override
            public void keyReleased(KeyEvent ke) {                
            }
        });
        
        //On startup sets selected category
        list.setSelectedValue(TODOManager.savedSettings.getSelectedCategory(), true);
        
        //Set style of the list, font, text size and alignment
        list.setFont(new Font("",Font.HANGING_BASELINE,18));
        list.setCellRenderer(new DefaultListCellRenderer(){
            @Override
            public int getHorizontalAlignment() {
                return CENTER;
            }
            });
        
        GridBagConstraints c = new GridBagConstraints();
        c.fill =GridBagConstraints.BOTH;
        c.gridx = 0;
        c.gridy = 3;
        c.weightx = 1;
        c.weighty = 10;
        
        this.add(list,c);
        
        
    }