@MarylynAlaso I can see you have posted this question in the ArcGIS Runtime for Java area so I'm assuming you are writing a JavaFX application.
When you are working with any types of features regardless on if it comes from OGC data, feature layers, or in your case shapefiles, you can perform a programatic "identify" operation. This basically allows you to get geometry and attribute information from the item you have just clicked on.
I've not used your specific data, but I've built upon an existing samples we have in git:
https://github.com/Esri/arcgis-runtime-samples-java/tree/master/feature_layers/feature-layer-shapefi...
I've added some extra code to listen into mouse click events and use that point to perform an identify operation. In its current form, the code just outputs text to the console, but it should help you to develop the next stage of your application.
// add the feature layer to the map
map.getOperationalLayers().add(featureLayer);
// listen into clicks and identify results
mapView.setOnMouseClicked(event -> {
System.out.println("clicked");
Point2D clickedPoint = new Point2D(event.getX(), event.getY());
// listenable future for waiting for results from identify on layer
ListenableFuture<IdentifyLayerResult> resultFuture = mapView.identifyLayerAsync(featureLayer,clickedPoint,10,false);
resultFuture.addDoneListener(() -> {
System.out.println("got result");
try {
// get the results from the future
IdentifyLayerResult result = resultFuture.get();
// loop through each element (probably only 1) and get the attributes
for (GeoElement element : result.getElements()) {
Map<String, Object> attributes = element.getAttributes();
System.out.println("attributes " + attributes);
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
});
});
Does this help?