JAVAFXのコンパイルエラーの改定質問
JAVAFXでのコンパイルエラー
javafxでボタンをつくっています。
コンパイルエラーが発生しました。
解決方法を教えて下さい。
設定状況
OS:Windows10 home and business
IDE・エディター:Visual Studio Code
使用ライブラリー:不明
JAVAのバージョン:
openjdk version "15.0.1" 2020-10-20
OpenJDK Runtime Environment (build 15.0.1+9-18)
OpenJDK 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
エラーメッセージの内容
C:\Users\azuma2580\OneDrive\デスクトップ\ProgramNetwork\java\java for everyone tsuiki>javac hello13_1.java
hello13_1.java:4: エラー: パッケージjavafx.scene.Conrtrolは存在しません
import javafx.scene.Conrtrol.;
^
hello13_1.java:5: エラー: パッケージjavafx.scene.Layoutは存在しません
import javafx.scene.Layout.;
^
hello13_1.java:10: エラー: シンボルを見つけられません
Button b1 = new Button("button1");
^
シンボル: クラス Button
場所: クラス hello13_1
hello13_1.java:10: エラー: シンボルを見つけられません
Button b1 = new Button("button1");
^
シンボル: クラス Button
場所: クラス hello13_1
hello13_1.java:11: エラー: シンボルを見つけられません
Button b2 = new Button("button2");
^
シンボル: クラス Button
場所: クラス hello13_1
hello13_1.java:11: エラー: シンボルを見つけられません
Button b2 = new Button("button2");
^
シンボル: クラス Button
場所: クラス hello13_1
hello13_1.java:12: エラー: シンボルを見つけられません
Label label = new Label("hello");
^
シンボル: クラス Label
場所: クラス hello13_1
hello13_1.java:12: エラー: シンボルを見つけられません
Label label = new Label("hello");
^
シンボル: クラス Label
場所: クラス hello13_1
hello13_1.java:13: エラー: シンボルを見つけられません
BorderPane root = new BorderPane();
^
シンボル: クラス BorderPane
場所: クラス hello13_1
hello13_1.java:13: エラー: シンボルを見つけられません
BorderPane root = new BorderPane();
^
シンボル: クラス BorderPane
場所: クラス hello13_1
hello13_1.java:17: エラー: 不適合な型: SceneをParentに変換できません:
Scene scene = new Scene(scene);
^
ノート:一部のメッセージは簡略化されています。-Xdiags:verboseで再コンパイルして完全な出力を取得してください
エラー11個
ソースコード
import javafx.application.Application;
import javafx.stage.;
import javafx.scene.;
import javafx.scene.Conrtrol.;
import javafx.scene.Layout.;
public class hello13_1 extends Application{
@Override
public void start(Stage pstage){
Button b1 = new Button("button1");
Button b2 = new Button("button2");
Label label = new Label("hello");
BorderPane root = new BorderPane();
root.setTop(label);
root.setLeft(b1);
root.setRight(b2);
Scene scene = new Scene(scene);
pstage.setTitle("hello");
pstage.sizeToScene();
pstage.show();
}
public static void main(String[] args) {
launch(args);
}
}
0 likes