Search code examples
javaswingjavafxawtoracle-spatial

Convert Shape from awt to Shape in javafx


I want to display Shape on Pane in JavaFx. I am using oracle JGeometry object selected from spatial database, it has a method createShape() but it returns java.awt.Shape.
Is it possible to create JavaFx object also so easily? Maybe I am just blind but I haven't found anything and don't want to program too much stuff on top. Thank you


Solution

  • Java only supports a handful of shapes, so it is not very difficult to write a little converter but if all you want to do is to draw the AWT shapes on a JavaFX canvas, then maybe this library can be helpful: http://www.jfree.org/fxgraphics2d/