Got left for his ex

This guy I was seeing for around 4 months just left me for his ex girlfriend who he dated for a couple years. And when he ended things I was supportive and didn’t want to be mean or anything and was kind to him and told him not to worry and that I want them to be happy because it was only 4 months and he dated her for 2 years. But now I’m just so mad because that was 4 months of my life I can’t get back and I’m the one sitting in my room crying while he’s out with his ex girlfriend but now new girlfriend again and he doesn’t even care which is the part that hurts. Do I have the right to be mad or am I just being selfish?