我想有一个JavaFX应用程序没有出现在任务栏中,也没有窗口装饰,我怎么能实现这一点,任何想法?JavaFX结合实用程序和透明舞台风格
编辑:
我已经试过这样:
Is it possible to have a transparent utility stage in javafx?
它工作正常,但图形是非常糟糕,所以这不是我的opinion.The坏的图形的好方法是由JFXPanel内部没有工作的抗锯齿引起的.JFXPanel似乎被窃听。
我想有一个JavaFX应用程序没有出现在任务栏中,也没有窗口装饰,我怎么能实现这一点,任何想法?JavaFX结合实用程序和透明舞台风格
编辑:
我已经试过这样:
Is it possible to have a transparent utility stage in javafx?
它工作正常,但图形是非常糟糕,所以这不是我的opinion.The坏的图形的好方法是由JFXPanel内部没有工作的抗锯齿引起的.JFXPanel似乎被窃听。
使用JavaFX无法做到这一点,但是我找到了使用Swing的解决方法。只需创建一个JFrame并将其类型设置为Type.UTILITY
并将Undercorated设置为true
即可。然后创建一个嵌入FX场景的JFXPanel。
JFrame frame = new JFrame();
frame.setType(Type.UTILITY);
frame.setUndecorated(true);
final JFXPanel mainJFXPanel = new JFXPanel();
frame.getContentPane().add(mainJFXPanel);
mainJFXPanel.setScene(getScene()); //The "getScene()" is just a placeholder
可以装饰你的(主)stage这个方法:
StageStyle.DECORATED - a stage with a solid white background and platform decorations.
StageStyle.UNDECORATED - a stage with a solid white background and no decorations.
StageStyle.TRANSPARENT - a stage with a transparent background and no decorations.
StageStyle.UTILITY - a stage with a solid white background and minimal platform decorations.
为了得到结果,你需要使用梅索德initStyle(StageStyle style)
。
这根本不回答我的问题。 ^^ 我确实知道,但我想要实用程序和透明,这是不可能的。就像我说的,我不希望我的窗户被装饰,我也不希望它出现在任务栏中。 – ScriptKiddy