Message Box"
From Documentation
m |
|||
Line 12: | Line 12: | ||
[[File:DrMessagebox.png]] | [[File:DrMessagebox.png]] | ||
+ | |||
+ | If you could specify a different icon for difference scenario, such as alerting an error: | ||
+ | |||
+ | <source lang="java"> | ||
+ | Messagebox.show("Unable to delete the file", null, 0, Messagebox.ERROR); | ||
+ | </source> | ||
+ | |||
+ | [[File:DrMessagebox-error.png]] | ||
+ | |||
+ | Another typical use is to confirm the users for a decision, such as | ||
+ | |||
+ | <source lang="java"> | ||
+ | Messagebox.show("Are you sure you want to remove the file?", null, | ||
+ | Messagebox.YES+Messagebox.NO, Messagebox.QUESTION, | ||
+ | new EventListener() { | ||
+ | public void onEvent(Event event) { | ||
+ | if (Messagebox.ON_YES.equals(event.getName())) | ||
+ | ;//delete the file | ||
+ | } | ||
+ | }); | ||
+ | </source> | ||
<blockquote> | <blockquote> |
Revision as of 09:49, 13 October 2011
In additions to composing your own window for displaying a message, ZK provide a simple utility: Messagebox[1]. For example,
Messagebox.show("The file has been removed successfully.");
If you could specify a different icon for difference scenario, such as alerting an error:
Messagebox.show("Unable to delete the file", null, 0, Messagebox.ERROR);
Another typical use is to confirm the users for a decision, such as
Messagebox.show("Are you sure you want to remove the file?", null,
Messagebox.YES+Messagebox.NO, Messagebox.QUESTION,
new EventListener() {
public void onEvent(Event event) {
if (Messagebox.ON_YES.equals(event.getName()))
;//delete the file
}
});
Version History
Version | Date | Content |
---|---|---|