Some fragment of code is incorrect

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: fx2.0
    • Component/s: docs
    • None

      http://st-doc.us.oracle.com/review/rsb/html/E20483_01/jfxpub-swing.htm

      Example 1

      public class Test {

          private static void initAndShowGUI() {
              // This method is invoked on the EDT thread
              JFrame frame = new JFrame("FX");
              final JFXPanel fxPanel = new JFXPanel();
              frame.add(fxPanel);
              frame.setVisible(true);

              Platform.runLater(new Runnable() {
                  @Override
                  public void run() {
                  initFX(fxPanel);
                  }
             });
          }

          private static void initFX(JFXPanel fxPanel) {
              // This method is invoked on the JavaFX thread
              Scene scene = createScene();
              fxPanel.setScene(scene);
          }

          public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                  @Override
                  public void run() {
                  initAndShowGUI();
                  }
              });
          }
      }

      Scene scene = createScene(); = It is not known by IDE where to take this code from.

            Assignee:
            Irina Fedortsova (Inactive)
            Reporter:
            Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: