private void setActions(){

        back = new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                new MainMenu(trolleyApp);
                removeActions();
            }
        };
        next = new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                 goToTagAction();
            }
        };
        calculateLoadWeigth = new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                try{
                    if(trolley.getPayLoad()<=0 || Integer.parseInt(totalWeigth.getText())<=0 || Integer.parseInt(totalWeigth.getText()) != trolley.getTotalWeight()){
                    for (Trolley t:trolleyApp.xmlp.getTrolleys()){
                        if(trolley.getTrolleyId()==t.getTrolleyId()){
                        trolley.setTotalWeight(Integer.parseInt(totalWeigth.getText()));
                        loadWeigth.setText(trolley.getPayLoad()+" kg");
                    }
                    }
                    }else{
                        goToTagAction();
                    }
                    trolleyApp.revalidate();
                    trolleyApp.repaint();
                }catch(NumberFormatException er){
                    JOptionPane.showMessageDialog(null, "Totalvekt på være et tall");
                    totalWeigth.requestFocus();
        }
            };
    };
                }