3

I have application written in JavaFX and I set primary stage as full screen and always on top:

primaryStage.setFullScreen(true);
primaryStage.setFullScreenExitHint("");
primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
primaryStage.setAlwaysOnTop(true);

In background thread I start another application and window from this application appears over my window (this window have also probably property "always on top").

How can I configure my window to be always on top?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
aredosz
  • 31
  • 4
  • So you have a full screen window. You open another window, but you never want to actually display it on the screen? I don't really understand this. Btw, you should call `setFullScreenExitKeyCombination` before you call `setFullScreen`, as on `setFullScreen` an internal copy is made from the combination, therefore setting the key combination after actually does nothing. – DVarga Jul 17 '16 at 09:18
  • My application have to run another application and I never want to display window from this another application. I can control this second application by TCP messages, so I don't need display windows from this application... – aredosz Jul 17 '16 at 09:37

1 Answers1

0

try this

primaryStage.initModality(Modality.APPLICATION_MODAL);
Jinu P C
  • 3,146
  • 1
  • 20
  • 29
  • I can't init modality because this is primary stage. When I try to set this I get exception: `Caused by: java.lang.IllegalStateException: Cannot set modality for the primary stage` – aredosz Jul 18 '16 at 14:16
  • This is more akin to a comment than an answer. – CosmicGiant Jul 18 '16 at 21:11