On Saturday 12 December 2009 11:55:48 am Elton Chan wrote:
> Hi there,
>
> I would like to create a messagebox after clicking a button on the toolbar.
> I have created a new icon with the actionTool extension.
>
> However, I try to use the following code in run().
>         Display display = new Display();
>         final Shell shell = new Shell(display);
>
>         MessageBox mb = new MessageBox(shell, SWT.OK);
>         mb.open();
>
> Is it the right way to do it or there is standard way to open a messagebox
> in udig? Please advise.
>
> Thanks,
> Elton

Hi Elton:
Try something the following code:

        PlatformGIS.syncInDisplayThread(new Runnable(){
            public void run() {
                Shell parent = display.getActiveShell();

                final MessageBox dialog = 
                                        new     MessageBox(parent,SWT.OK);
                dialog.open();
            }
        });
cheers
-- 
Mauricio Pazos
www.axios.es
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to