2

I am making a javafx application and I made the border around it invisible but now I would like to know how to "fake" someone from clicking on the fullscreen button (in Windows the middle button in the right top corner). I know how to make it 100% fullscreen but I just want to know how to "fake" the clicking of the windows fullscreen button.

Thanks.

Victor2748
  • 4,149
  • 13
  • 52
  • 89
Hendrik
  • 73
  • 1
  • 1
  • 7
  • Can you maybe clarify your question? Do you want to have a button that toggles fullscreen behaviour or just maximize the stage or what? – Matt Coubrough Dec 10 '14 at 23:16
  • I didnt know the name of it but its the "maximize button" read the the answers if you want more info :) – Hendrik Dec 11 '14 at 00:06

1 Answers1

2

Solution

I think you refer to a maximize button, and perhaps the stage.setMaximized() method.

Maximized != Full Screen

Setting the stage fullscreen viastage.setFullScreen() is generally a different thing than maximizing a stage. A full screen stage operates in full screen exclusive mode (i.e. no windowing at all, the stage takes over the entire display).

Related

What you seem to be doing is creating an undecorated window (i.e. a window with no default OS window frame and no in-built controls for resizing, title and minimize/maximize/close), but you still want some of the functionality that you would get if the window were decorated (by adding your own custom decoration controls to provide it). For more information on how to tackle that problem, see the related question:

In particular, checkout the Undecorator project, which is the defacto standard way of supplying such functionality for JavaFX.

Community
  • 1
  • 1
jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • Side note: On windows `setMaximized()` hides the taskbar. That is where the undecorator comes into play. – eckig Dec 11 '14 at 10:40