Timer inside to a Listener

Hi,

I saw that timer works very well inside to init (onIntit) method.
How can I use timer inside to a listener?

public class ExtAppLoginWindow extends AppLoginWindow {

 @Subscribe
    private void onInit(InitEvent event) {
 loginButton.addClickListener(e ->{
...timer here...with notification
        });
    }
}

I need a timer in this window:
image

Hi,
Do you need something like setTimeout(function, timeout) in JavaScript, i.e. to execute some code after a delay?

With or without delay it’s ok. My problem is that I don’t know which window is this (after login) and which event trigger it:
image

I have ExtAppLoginWindow extends AppLoginWindow extends AbstractWindow.
If I set a script inside to login Button (or a timer under onInit) works only here (before login):
image

The single solution that works after login seems to be the notifications:

loginButton.addClickListener(e ->{
notifications.create().withCaption("<i>Warning notification after login</i>").withType(Notifications.NotificationType.WARNING)
             .withContentMode(ContentMode.HTML).withHideDelayMs(5000).show();
 });

but the notification disapear after any click.
I want some notification (could be javascript as well) that persist(after login) - let say 30 seconds -without posibility to close it.

I believe you have already discussed this problem in another topic.

Yes but doesn’t work, so I expect another hint from your side.

Solved: used - public class ExtAppMainWindow extends AppMainWindow