2016-04-06 45 views

回答

0

使用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 
1

可以装饰你的(主)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)

+0

这根本不回答我的问题。 ^^ 我确实知道,但我想要实用程序和透明,这是不可能的。就像我说的,我不希望我的窗户被装饰,我也不希望它出现在任务栏中。 – ScriptKiddy