Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8118053

Some fragment of code is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • fx2.0
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported: