public void update(){
        int num=buttonSelected();
        if(scrollUp!=null&&scrollUp.getIndex()==num)
            scrollUp();
        if(scrollDown!=null&&scrollDown.getIndex()==num)
            scrollDown();
        if(accept!=null&&accept.getIndex()==num)
            add();
        if(reject!=null&&reject.getIndex()==num)
            remove();
    }