How to set notification location?

Hellow guys!

I am using notification in my application, like this

main.showNotification("Granted!", "You are now logged in", Window.Notification.TYPE_HUMANIZED_MESSAGE);

now i want to create a notification object so that i can set a location, and delay time.

but how?

Create a new Notification() and show it with window.showNotification().

Like so:

                
Notification n = new Notification("Remember!");
n.setDelayMsec(5000);
n.setPosition(Notification.POSITION_TOP_LEFT);
getMainWindow().showNotification(n);

This will show a notification for 5 seconds (after you move the mouse or press a button) in the upper left.

See Window.Notification for more info - you can configure some other stuff as well, such as stylename, icon etc.

A bit off-topic:
From a usability standpoint, you should avoid getting too crazy with icons and such, though - the notifications are designed to interfere as little as possible and draw just as much attention as needed, not more. For a great article on the subject, read Aza Raskin’s article: http://www.humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/