I want my application to stick to the borders of screen when I move it - I mean when it's not further than 5px from the edge it should stick to it. (i. e. Winamp has it). How to achieve this? I can't do it in moveEvent, because of possible infinite recursion (it doesn't work, anyway :P) , overloading 'move' method doesn't work either.