0
我无法在浏览器中运行javafx hello world! 我的代码是我无法在浏览器中运行javafx hello world
public class FxInBrowser extends Application {
@Override
public void start(Stage primaryStage) {
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
我已经在NetBeans中选择“运行方式浏览器”。
Thanx提前
在这种情况下,'无法'意味着什么? – home 2013-05-01 11:59:42
添加例外,如果有任何和你的环境细节。 – 2013-05-01 11:59:50
我推荐以下Oracle的[Java SE 7桌面技术疑难解答指南](http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/plugin.html)。如果它解决了您的问题,请自己回答您的问题,说明您如何解决问题。如果您仍有问题,请更新您的问题,以包含您按照指南获得的额外诊断信息。 – jewelsea 2013-05-02 19:53:21