I tell you what, it's all about experience. Earlier i was myself jumping from chair in a Phil Hellmuth's style after having my AA beat against some funky J2s and yelling bad words, scaring my family in other room. But you know what, more poker you play, less such things bother you. I mean, i can't say it isn't suck anymore, it is always, but you take it more easy. Meanwhile, when i see such things happen i'm not jumping or yelling or smashing my display with a keyboard. Not at all, i'm just sceptically grin and might say silently: "yeah right, that's typical". And try to forget that beat so fast as possible, cause i have to play further and not ruin the whole game because of that one hand. You learn it automatically with time and experience.
However if it's still pretty hard for you, not to dive in a tilt after such beats, i recommend you multitabling. It could help, it make you more busy playing at many tables and you are kinda distracted from your feelings. Also it doesn't feel that bad if you lost half stack on one of 6 or 8 your tables. At one you have lost at another you just won, you know. Not taking so close to heart, as it was the only table you play. Just try not to overdoing your multitabling, so that you not play too many tables and still can concentrate on making good decisions.