Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That should be quite easy to solve. Let me explain it with the chart example that you've shown. </p> <ol> <li><p>Add an instance of <code>JFXPanel</code> to your <code>JFrame</code>. In your examples, all components are added to a <code>Stage</code>, which is the JavaFX class to represent a window. So you don't need it here. Instead, you add the components that you want to use to the JFXPanel. See also <a href="http://docs.oracle.com/javafx/2/swing/swing-fx-interoperability.htm#CHDIEEJE" rel="nofollow">here</a> (function <code>initAndShowGUI</code>) how to do it.</p></li> <li><p>In the <code>init</code> function of the example, a <code>Scene</code> is created as well as the chart itself. What you have to do to let the chart be shown is not much more than that - create a <code>Scene</code>, fill it with content and pass it to the <code>JFXPanel</code> that you already created. </p></li> <li><p>With a minimum effort you can make your chart example run: Make sure that <code>AdvancedLineChartSample.java</code> is in your build path and that the function <code>createChart</code> is somehow accessible from your JFrame. Then add the chart to your code with something similar to the following snippet.</p></li> </ol> <pre> Group root=new Group(); Scene scene=new Scene(root); myJFXPanel.setScene(scene); root.getChildren().add(createChart()); </pre> <p>This is just a very quick and dirty solution to run your example without any beautiful code and also I didn't test it. But hopefully it gives you a basic understanding of what's going on to encourage further experiments. By my own experience I can tell you that from this step on, there's a lot of fun to come with JavaFX 2.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload