[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Notification dialogs

Keya wrote:
Hi,

Can we create notification dialog boxes in SWT? I want a pop-up Message or an Error Dialog which remains for a certain amount of time and goes off after that if no user intervention happens. It should not wait for the user to click "Ok" or "Yes" or any such button to dispose the dialog. How can we achieve this behavior?

I think you'll have to write the automatic dismissal part yourself; I don't think SWT or JFace have any such feature. But it should be pretty simple to do so. You'll probably want to subclass org.eclipse.jface.dialogs.MessageDialog
Note the Window.open() method, which can be controlled to either block or not block until the dialog is dismissed. One approach would be to call setBLockOnOpen(false) before opening your dialog and then set up a java.util.Timer to close it after your desired timeout period.


Hope this helps,
	Eric