mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50:56 +03:00
Demo: if disabling window decoration ("Options > Window decorations") , which changes the main window, also invoke JDialog.setDefaultLookAndFeelDecorated() to disable window decorations for dialogs
This commit is contained in:
@@ -141,11 +141,16 @@ class DemoFrame
|
|||||||
private void windowDecorationsChanged() {
|
private void windowDecorationsChanged() {
|
||||||
boolean windowDecorations = windowDecorationsCheckBoxMenuItem.isSelected();
|
boolean windowDecorations = windowDecorationsCheckBoxMenuItem.isSelected();
|
||||||
|
|
||||||
|
// change window decoration of demo main frame
|
||||||
dispose();
|
dispose();
|
||||||
setUndecorated( windowDecorations );
|
setUndecorated( windowDecorations );
|
||||||
getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE );
|
getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE );
|
||||||
menuBarEmbeddedCheckBoxMenuItem.setEnabled( windowDecorations );
|
menuBarEmbeddedCheckBoxMenuItem.setEnabled( windowDecorations );
|
||||||
setVisible( true );
|
setVisible( true );
|
||||||
|
|
||||||
|
// enable/disable window decoration for later created frames/dialogs
|
||||||
|
JFrame.setDefaultLookAndFeelDecorated( windowDecorations );
|
||||||
|
JDialog.setDefaultLookAndFeelDecorated( windowDecorations );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuBarEmbeddedChanged() {
|
private void menuBarEmbeddedChanged() {
|
||||||
|
|||||||
Reference in New Issue
Block a user