Are you saying the listener is not fired when you add it to the panel but hover over the border of the panel? I find that hard to believe. Can you add an SSCCE that shows the effect?
–
Andrew ThompsonJan 11 '12 at 3:17

Yes but then this mouseListener will be added for the whole JPanel. Not only for my Border. Am I wrong?
–
DejwiJan 11 '12 at 9:37

You can always ignore events within the border.
–
Andrew ThompsonJan 11 '12 at 9:53

You are correct but you can always check if the mouse point is withing the insets of the panel. Or another option is to nest one panel within another panel. Then the inner panel will cover the outer panel.
–
camickrJan 11 '12 at 16:02

phaaa not, never see there reason for down_vote, my view/image going to the similair way (-: I use only JFrame by default :-), maybe Jeannete could be notified about setPreferredSize instead of setSize but this is details for reall top_hight_level GUI programing (habits) in Swing
–
mKorbelJan 11 '12 at 11:01