mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 16:25:10 +03:00
FlatWindowDecorationsTest: update decoration style radio buttons from window
This commit is contained in:
@@ -91,6 +91,14 @@ public class FlatWindowDecorationsTest
|
|||||||
|
|
||||||
JRootPane rootPane = getWindowRootPane();
|
JRootPane rootPane = getWindowRootPane();
|
||||||
if( rootPane != null ) {
|
if( rootPane != null ) {
|
||||||
|
updateDecorationStyleRadioButtons( rootPane );
|
||||||
|
rootPane.addPropertyChangeListener( "windowDecorationStyle", e -> {
|
||||||
|
updateDecorationStyleRadioButtons( rootPane );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateDecorationStyleRadioButtons( JRootPane rootPane ) {
|
||||||
int style = rootPane.getWindowDecorationStyle();
|
int style = rootPane.getWindowDecorationStyle();
|
||||||
if( style == JRootPane.NONE )
|
if( style == JRootPane.NONE )
|
||||||
styleNoneRadioButton.setSelected( true );
|
styleNoneRadioButton.setSelected( true );
|
||||||
@@ -100,9 +108,16 @@ public class FlatWindowDecorationsTest
|
|||||||
stylePlainRadioButton.setSelected( true );
|
stylePlainRadioButton.setSelected( true );
|
||||||
else if( style == JRootPane.INFORMATION_DIALOG )
|
else if( style == JRootPane.INFORMATION_DIALOG )
|
||||||
styleInfoRadioButton.setSelected( true );
|
styleInfoRadioButton.setSelected( true );
|
||||||
else
|
else if( style == JRootPane.ERROR_DIALOG )
|
||||||
throw new RuntimeException(); // not used
|
styleErrorRadioButton.setSelected( true );
|
||||||
}
|
else if( style == JRootPane.QUESTION_DIALOG )
|
||||||
|
styleQuestionRadioButton.setSelected( true );
|
||||||
|
else if( style == JRootPane.WARNING_DIALOG )
|
||||||
|
styleWarningRadioButton.setSelected( true );
|
||||||
|
else if( style == JRootPane.COLOR_CHOOSER_DIALOG )
|
||||||
|
styleColorChooserRadioButton.setSelected( true );
|
||||||
|
else if( style == JRootPane.FILE_CHOOSER_DIALOG )
|
||||||
|
styleFileChooserRadioButton.setSelected( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unifiedBackgroundChanged() {
|
private void unifiedBackgroundChanged() {
|
||||||
|
|||||||
Reference in New Issue
Block a user