A simple helper to pop up a Dilbert strip dialog
To show a Dilbert strip on a dialog call
new Dilbert(username).show(DilbertType.ofTheDay)Possible DilbertType types are:
ofTheDaytodays (or yesterdays if not already published) striprandomrandom strip from all published stripsnextFavoritethe next strip marked as favorite (remembers last shown favorite for each user)randomFavoritea random strip out of all strips marked as favorites
Each user (determined by username) will only see a strip once a day, to force it use true as second parameter:
new Dilbert(username).show(DilbertType.ofTheDay, true)To use the component in an application using maven, add the following dependency to your pom.xml:
<dependency>
<groupId>org.vaadin.addons.metainfo</groupId>
<artifactId>dilbert</artifactId>
<version>${component.version}</version>
</dependency>
- Import this maven project to your favourite IDE
- Run jetty:run, navigate to localhost:8080, and try out the different Dilbert types
Dilbert © Andrews McMeel Syndication, https://dilbert.com
Apache License 2