i am using ArcGIS Library for a geospatial project. the sample codes available in their website was fully in java Swing. i need to do path animation in it using javaFX. is it possible.? if yes, can any one suggest me a sample code to create a map.? Sample code for creating a map in Swing
3 Answers
I don't think you can pull this off using JavaFX
, since JMap
extends JComponent
and is a class provided by the ArcGIS
. Unless, they release a version which is supporting JavaFX
, things are not very good.
The least you can do is to embed this JMap
into a JavaFX
application using SwingNode
. An example on how to achieve this can be found here.
I am not sure what you want to achieve, when you say "path animation in it", but if it has something that can be achieved without using the internal components of JMap
, you can do it !

- 36,135
- 10
- 122
- 176
-
Actually i am using JMap just to show a map and use zoom in zoom out options. i am using SQL to get the LAT/LONG values and create a path on the map and make an object move on the path. is it possible to perform..? – srinivasan ramesh Sep 24 '14 at 04:49
-
Is the path specific to `JMap` ? if not, you can create a similar thing using [Path Transition](http://docs.oracle.com/javafx/2/animations/basics.htm#CJAFDCGH) – ItachiUchiha Sep 24 '14 at 05:17
-
i think its to JMap. will create a path on JMap only. – srinivasan ramesh Sep 24 '14 at 05:58
-
Then why not do it JMap way ? – ItachiUchiha Sep 24 '14 at 06:01
-
yes. i saw the samples just now. its available directly in JMap. thanks for your valuable time. – srinivasan ramesh Sep 24 '14 at 08:09
-
@ItachiUchiha: Can JMap be used with JavaFx? and do all the stuff with JavaFX using JMap? – Deepak May 11 '15 at 01:47
JMap
is a Swing component. JavaFX 1 was built on Swing and supported wrapping a Swing component. JavaFX 2 does not use Swing and does not support wrapping a Swing component. It is anticipated that the upcoming JavaFX 8 will support using Swing components in a JavaFX application.
UPDATE: ArcGIS Runtime is getting support for JavaFX! See http://blogs.esri.com/esri/arcgis/2014/09/17/arcgis-runtime-plays-at-10-2-4/ for details.
You have some options:
- Go back to JavaFX 1 (not a good idea IMO)
- Turn it around and use JavaFX components in a Swing application (see http://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm)
- Wait for Java 8, or go get the developer preview of Java 8.
- Wait for ArcGIS Runtime 10.2.4 (to be released any day now), which will have beta support for JavaFX.
Sources:

- 1
- 1

- 4,764
- 3
- 25
- 35
Maybe a bit late but... ArcGIS Runtime for Java's latest beta (Quartz) offers much more JavaFX support.
https://developers.arcgis.com/java/beta/guide/release-notes-java.htm

- 474
- 6
- 8