23 Nisan 2018 Pazartesi

JavaFX Scene Sınıfı

Giriş
Şu satırı dahil ederiz.
import javafx.scene.Scene;
Bu sınıf şöyle kullanılır.
public class Main extends Application {

  @Override
  public void start(Stage primaryStage) throws Exception {
    ...
    Scene scene = new Scene(rootPane, 400, 400);
    primaryStage.setTitle("...");
    primaryStage.setScene(scene);
    primaryStage.show();
  }
}
constructor
Açıklaması şöyle
- A scene represents the physical contents of a JavaFX application. It contains all the individual controls or components.
- An application can have more than one scene, but only one of the scenes can be displayed on the stage at any given time.
- The size of the scene can be specified by passing its dimensions (height and width) along with the root node to its constructor.
Şöyle yaparız.
BorderPane rootPane  = new BorderPane();
...
Scene scene = new Scene(rootPane, 400, 400);
getStyleSheets metodu
Şöyle yaparız.
scene.getStylesheets().add(...);




Hiç yorum yok:

Yorum Gönder