@Override
    public boolean dispatchKeyEvent(KeyEvent e) {

        if ( e.getID() == KeyEvent.KEY_RELEASED){
            if ( e.isControlDown() ) {
                switch (KeyEvent.getKeyText(e.getKeyCode())){
                    case "W":
                        tabPane.remove(tabPane.getSelectedIndex());
                        return true;
                    case "Tab":
                        int size = tabPane.getTabCount();
                        int index = tabPane.getSelectedIndex();
                        if ( e.isShiftDown() ){ //Move down the list of tabs
                            index = (index + size - 1) % size;
                        } else { //Move up the list of tabs
                            index = (index + 1) % size;
                        }
                        tabPane.setSelectedIndex(index);
                        return true;
                }
            }
        }
        return false;
    }