}
@Override
protected ComponentEvent previewEvent(EventType type, ComponentEvent ce) {
if (ce instanceof WindowEvent) {
WindowEvent we = (WindowEvent) ce;
MessageBoxEvent e = new MessageBoxEvent(MessageBox.this, this, we.getButtonClicked());
if (type == Events.Hide || type == Events.BeforeHide) {
if (textBox != null) {
e.setValue(textBox.getValue());
} else if (textArea != null) {
e.setValue(textArea.getValue());