LoginSignup
0
0

More than 1 year has passed since last update.

【Scala】BooleanProperty を反転させる

Posted at

JavaFX で、「フルスクリーンの時にツールバーを表示する」ということを実現したい場合、 bind() を用いて以下のようにコードを書けばよい。

toolBar.visibleProperty().bind(primaryStage.fullScreenProperty())
toolBar.managedProperty().bind(primaryStage.fullScreenProperty())

一方、「フルスクリーンでない時にツールバーを表示する = フルスクリーンの時にツールバーを非表示にする」ということを実現したい場合は、 .not() を用いて BooleanProperty を反転させればよい。

toolBar.visibleProperty().bind(primaryStage.fullScreenProperty().not())
toolBar.managedProperty().bind(primaryStage.fullScreenProperty().not())
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0