I have a normal JFrame (one part of the app) and a second JavaFX window (I can't use a JFrame for the JavaFX stage). The problem is that the JavaFX window should always be on top of all other windows.
I have no idea how I should solve this problem! Any ideas?
I know this is a old thread, but things keep on changing. Coming to JDK 8u20 is a new method primaryStage.setAlwaysOnTop(true);
This would be the easiest way to make a stage always on top. For early access to 8u20 visit the website.
public class KeyholeDemo extends Application {
@Override public void start(Stage primaryStage) {
primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.setAlwaysOnTop(true);
// code omitted...
}
public static void main(String[] args) {
launch(args);
}
}
Sample code taken from this nice writeup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With