Tuesday, June 26, 2007

Swing

This ain't really a dumb mistake or anything like that, but it kept me in the office till pretty late in the night today so i will give it credit by posting it here.

There will come a time when you need to do some fancy stuff like changing ur cursor's icon while you are hovering a Swing component. What i tried today was to change my cursor while hovering across a JLabel. What was supposed to be a one liner turned out to be irritating. Somehow the JLabel's setCursor() method won't work, in the end i had to resort to creating some MouseListeners over the Jlabel and set cursor for the frame instead. Its quite untidy but i guess its a temporary patch.

No comments: