How to make a JavaFX widget

Can I stick to the scene on the desktop?

I want to run my application as a widget, so when it starts, it should be displayed directly above the desktop, and not in front of the current application, which can be opened.

Another condition for the widget will be that it does not have a taskbar entry. Is it also possible?

+5
source share
1 answer

I tried this with JavaFX 2.2 and had the following results:

therefore, when it starts, it should be displayed directly above the desktop, and not in front of the current application, which can be opened

A call to stage.toBack will place the scene behind any other windows.

, ( , Mac). , .

stage.focusedProperty().addListener(new ChangeListener<Boolean>() {
  @Override
  public void changed(ObservableValue<? extends Boolean> observableValue, Boolean wasFocused, Boolean focused) {
    stage.toBack();
  }
});

stage.addEventFilter(MouseEvent.ANY, new EventHandler<MouseEvent>() {
  @Override
  public void handle(MouseEvent mouseEvent) {
    stage.toBack();
  }
});

. , .

,

Windows , StageStyle.UTILITY, Windows Windows.

OS X, Java OS X, ( ), Java. , OSA self-contained, , .

( ) JavaFX. - , , .

+6

All Articles