[vtkusers] VTK and JavaFX?

Sebastien Jourdain sebastien.jourdain at kitware.com
Tue Aug 5 13:59:24 EDT 2014


I've never played with JavaFX and VTK, but someone in the community may
have...


On Tue, Aug 5, 2014 at 10:28 AM, Mark Edgar Hammons II <
mark.hammons at inaf.cnrs-gif.fr> wrote:

>  Has anyone tested vtk and javafx compatibility yet? I'm using 5.10, and
> nothing but the regular java swing components are rendered when I embed this
> class
> <https://github.com/jeffbaumes/jeffbaumes-vtk/blob/master/Wrapping/Java/SimpleVTK.java>
> into a javafx scene using SwingNode:
>
>
>
> > import javafx.application.Application;
>
> > import javafx.embed.swing.SwingNode;
>
> > import javafx.scene.Scene;
>
> > import javafx.scene.layout.StackPane;
>
> > import javafx.stage.Stage;
>
> >
>
> > import javax.swing.*;
>
> >
>
> > public class SwingFx extends Application {
>
> >
>
> > @Override
>
> > public void start(Stage stage) {
>
> >
>
> > final SwingNode swingNode = new SwingNode();
>
> > createAndSetSwingContent(swingNode);
>
> >
>
> > StackPane pane = new StackPane();
>
> > pane.getChildren().add(swingNode);
>
> >
>
> > stage.setScene(new Scene(pane, 100, 50));
>
> > stage.show();
>
> > }
>
> >
>
> > private void createAndSetSwingContent(final SwingNode swingNode) {
>
> > SwingUtilities.invokeLater(new Runnable() {
>
> > @Override
>
> > public void run() {
>
> > swingNode.setContent(new SimpleVTK());
>
> > }
>
> > });
>
> > }
>
> >
>
> > public static void main(String[] args) {
>
> > launch(args);
>
> > }
>
> > }
>
>
>
> I'm testing on my side with openJFX so I can't be sure that this doesn't
> work with javafx proper just yet. I'll try with the regular oracle jvm
> later today/tomorrow. Has there been any efforts to make vtkPanel and
> vtkCanvas work with javafx yet though?
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140805/0392c66e/attachment.html>


More information about the vtkusers mailing list