Window decorations: title bar was not hidden if window is in full-screen mode (issue #212)

This commit is contained in:
Karl Tauber
2020-11-18 23:31:04 +01:00
parent 59879f493e
commit d923c8df81
6 changed files with 51 additions and 5 deletions

View File

@@ -186,6 +186,13 @@ public class FlatWindowDecorationsTest
}
}
private void fullScreenChanged() {
boolean fullScreen = fullScreenCheckBox.isSelected();
GraphicsDevice gd = getGraphicsConfiguration().getDevice();
gd.setFullScreenWindow( fullScreen ? SwingUtilities.windowForComponent( this ) : null );
}
private void menuItemActionPerformed(ActionEvent e) {
SwingUtilities.invokeLater( () -> {
JOptionPane.showMessageDialog( this, e.getActionCommand(), "Menu Item", JOptionPane.PLAIN_MESSAGE );
@@ -263,6 +270,7 @@ public class FlatWindowDecorationsTest
resizableCheckBox = new JCheckBox();
maximizedBoundsCheckBox = new JCheckBox();
undecoratedCheckBox = new JCheckBox();
fullScreenCheckBox = new JCheckBox();
JLabel label1 = new JLabel();
JLabel label2 = new JLabel();
JPanel panel1 = new JPanel();
@@ -372,6 +380,11 @@ public class FlatWindowDecorationsTest
undecoratedCheckBox.addActionListener(e -> undecoratedChanged());
add(undecoratedCheckBox, "cell 0 4");
//---- fullScreenCheckBox ----
fullScreenCheckBox.setText("full screen");
fullScreenCheckBox.addActionListener(e -> fullScreenChanged());
add(fullScreenCheckBox, "cell 1 4");
//---- label1 ----
label1.setText("Style:");
add(label1, "cell 0 5");
@@ -677,6 +690,7 @@ public class FlatWindowDecorationsTest
private JCheckBox resizableCheckBox;
private JCheckBox maximizedBoundsCheckBox;
private JCheckBox undecoratedCheckBox;
private JCheckBox fullScreenCheckBox;
private JRadioButton styleNoneRadioButton;
private JRadioButton styleFrameRadioButton;
private JRadioButton stylePlainRadioButton;

View File

@@ -106,6 +106,16 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "fullScreenCheckBox"
"text": "full screen"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "fullScreenChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1"
"text": "Style:"