@Override
    public void actionPerformed(ActionEvent e) {
        if (!end){
            n.moveR();
            if(n.x==650){end=true;}
        }else {n.moveL();
        if(n.x==10){end=false;}}

        repaint();

    }