0
내 첫 자바 FX 애플리케이션 코드안전하지 않은 작업은
package helloworld;
import javafx.application.*;
import javafx.stage.*;
import javafx.event.*;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
public class HelloWorld2 extends Application
{
@Override
public void start(Stage stage)
{
stage.setTitle("Hello World");
Button btn = new Button();
btn.setText("Hello");
btn.setOnAction(new Action());
StackPane pane = new StackPane();
pane.getChildren().add(btn);
stage.setScene(new Scene(pane, 300,250));
stage.show();
}
private class Action implements EventHandler
{
@Override
public void handle(Event arg0)
{
System.out.println("JavaFX World");
}
}
public static void main(String[]args)
{
launch(args);
}
}
나는이 프로그램을 실행할 때 나는 "안전하지 않은 조작"경고를 얻고에서 참조하시기 바랍니다. 응용 프로그램은 예외없이 실행됩니다. 나는 어떤 장소에 키워드를 써야하기 때문에 안전하지 않은 것이오고 있다고 믿는다. 그러나 나는 어디 있는지 모른다. 도와주세요!
Unsade == 해피 이벤트의 유형을 지정해야합니까? ;) –
@PeterLawrey : 하하, 예, 인쇄 실수 ...) LOL : D 고맙습니다. Uluk에게 고쳐 주셔서 감사합니다. :) –