A Label that removes itself after a delay
TemporaryLabel removes itself when eihter a) the user clicks the label, or b) the next repaint occurs after a specified delay.
Think of it as a inline Notification: you add it to the layout at a specific place. This is often better from a usability standpoint.
It comes with three build-in styles (default, "warning", "error").
If the delay is (for example) 3000msec, the label will stay on screen at least 3sec (if the user does not manually remove it by clicking), and the disappear when the user interacts with the application.
This version of TemporaryLabel uses a Thread to remove itself, and can thus not be used with GAE.
layout.addComponent(new TemporaryLabel( "This one was added at " + new Date(), TemporaryLabel.STYLE_WARNING, 3000));
Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.
- Apache License 2.0
- Vaadin 6.0+