Individual tray notification with delay not working

Hi,
I am trying to display a trayinfo like message but just in the center instead. It looks like setDelayMsec is not working.

[code]
Notification notifyMsg = new Notification(“”, Notification.Type.TRAY_NOTIFICATION);
notifyMsg.setHtmlContentAllowed(true);
if (title != null && !title.isEmpty()) notifyMsg.setCaption(title);
if (text != null && !text.isEmpty()) notifyMsg.setDescription(text);

        if (showCentered)
            notifyMsg.setPosition(Position.MIDDLE_CENTER);
        else
            notifyMsg.setPosition(Position.BOTTOM_RIGHT);

        notifyMsg.setDelayMsec(3000);
        if (text.length() > 40) notifyMsg.setDelayMsec(5000);
        if (text.length() > 120) notifyMsg.setDelayMsec(7000);

        notifyMsg.show(Page.getCurrent());

[/code]What can be the problem here? I get the message displayed until I click on it. I am using vaadin 7.6.8.

It looks like this is working if I do not use debugging mode in NetBeans stopping around there. So just seems to be an issue while in debug mode. So it’s ok.