[Gvsig_english] Creating a new View in the Project Window

Bruno Gomes semog15 at gmail.com
Fri Apr 23 02:12:12 CEST 2010


I need to add a new layer to the current ProjectWindow, my code looks like:

IWindow iwin = PluginServices.getMDIManager().getActiveWindow();

                if(iwin instanceof ProjectWindow){

                     View vista = new View();
                     ProjectView pvb = new ProjectView();

                     vista.initialize();
                     vista.setModel(pvb);
                     PluginServices.getMDIManager().addWindow(vista);
                }

But i get a error[1] when i try to set the view model.
How should i set the ProjectView? Any ideas?

java.lang.NullPointerException
    at
com.iver.cit.gvsig.project.documents.view.gui.View.setModel(View.java:172)



-- 
Bruno Gomes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20100423/7ddce57a/attachment.htm 


More information about the Gvsig_internacional mailing list