This is specially useful for messages that you feel obligated to display, but that the user will most likely only be interested in on the first time he ever sees it.
Well, there's a special class called the BoxInfoOnce which does all of the work for us. It constructs the message form, and controls the user cache as to whether the user chose to not see given message again or not. With the simple code below, you can successfully display a message to the user that he can choose to hide in future executions:
BoxInfoOnce boxInfoOnce = new BoxInfoOnce(); boxInfoOnce.parmHeading("This is a heading"); boxInfoOnce.parmInformation("This is the information"); boxInfoOnce.prompt();
The code above produces the following form:
Since the user's choice is kept as cache, if he or she resets their usage data, their choice will be reset.