lundi 11 mai 2015

Can't launch the java program

I found this code on the site oracle but I can't launch with Eclipse it's saying me "Unable to launch". I have installed JDK 8 but it doesn't work...

Anybody have a solution please ? :p

public class SwingFX extends Application {

@Override
public void start (Stage stage) {
    final SwingNode swingNode = new SwingNode();

    createSwingContent(swingNode);

    StackPane pane = new StackPane();
    pane.getChildren().add(swingNode);

    stage.setTitle("Swing in JavaFX");
    stage.setScene(new Scene(pane, 250, 150));
    stage.show();
    }

private void createSwingContent(final SwingNode swingNode) {
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            swingNode.setContent(new JButton("Click me!"));
        }
    });
}
}

link to the website where I found the code : http://ift.tt/1Ffsv46

Aucun commentaire:

Enregistrer un commentaire