Try not to get too worried about it (I know, easier said than done). When you go back to that class, it probably won't even be mentioned by your teacher. The thing is, people in high school (I'm assuming you must be in high school) do things like that all the time!!! And most of them never worry about it. Probably by next class, someone else will have gotten in trouble and the teacher will have forgotten about you (although if you get into more trouble later on, she'll probably remember). It's too bad she had to be nasty about it (although I sympathize with teachers and what they have to deal with on a daily basis - not that I mean you personally - it's just that there are a lot of disrespectful and/or behaviourally screwed up kids out there).
On a personal note, one time when I was in grade 9, the gym teacher assigned the class a "game-creating project" that we were supposed to work on in groups of 2 or 3. Of course, I ended up alone and felt really humiliated and angry. When the teacher made a comment about my sitting alone during class, I couldn't take it and just stormed out in tears. He never came to get me and I was so embarrassed to go back to that class after (I'm sure some of my classmates had noticed too). Nothing was ever mentioned though and the project fell through anyway (thank god) so the worst part was my dreading the next class rather than how the class actually went.