laptop and a wrench

Error

ArcMap isn't refreshed when using a modal JFileChooser in a Java Add-In.

Última publicación: August 25, 2014 ArcGIS for Desktop
Número de ID del error NIM062344
EnviadoOctober 27, 2010
Última modificaciónJune 5, 2024
Relacionado conArcGIS for Desktop
Versión encontrada10.0
Lenguaje del programaJava
Sistema operativoWindows OS
Versión de sistema operativo2008
EstadoWill Not Be Addressed

Información adicional

We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.

Solución alternativa

Show a non-modal dialog as with the code below.SwingUtilities.invokeLater(new Runnable() { public void run() { try{ JFileChooser fileChooser = new JFileChooser(); // Create a filter only to show .shp files in file chooser ShapeFileFilter filterSHP = new ShapeFileFilter(); filterSHP.addExtension("shp"); fileChooser.setFileFilter(filterSHP); int returnVal = fileChooser.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); IFeatureWorkspace workSpace = (IFeatureWorkspace) workspaceFactory.openFromFile(file.getParent(), 0); IFeatureClass featureClass = null; featureClass = workSpace.openFeatureClass(file.getName().substring(0,(file.getName().length()-4))); IFeatureLayer layer = null; layer = new FeatureLayer(); layer.setFeatureClassByRef(featureClass); layer.setName(featureClass.getAliasName()); mxDoc = (IMxDocument) app.getDocument(); mxDoc.getFocusMap().addLayer(layer); mxDoc.getActiveView().partialRefresh(esriViewDrawPhase.esriViewGeography, layer, null); } } catch (Exception e) { e.printStackTrace(); } } });

Pasos para reproducir

ID del error: NIM062344

Software:

  • ArcGIS for Desktop

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga