Skip to content

Custom window decoration works incorrectly in some cases #604

@mgarin

Description

@mgarin

Reported by @kovadam69 on gitter:

if I add JDialog.setDefaultLookAndFeelDecorated(true);, the dialog header is changed to system decoration

    public static void main ( String[] args )
    {
        SwingTest.run (new Runnable ()
        {
            public void run ()
            {
                NativeFonts.setUseNativeFonts ( false );
                WebLookAndFeel.install();
                JDialog.setDefaultLookAndFeelDecorated(true);

                final WebDialog loginForm = new WebDialog ( StyleId.dialogDecorated, (Window) null, "Sample dialog" );

                loginForm.getContentPane().add(new WebButton("Press me", (e) ->
                {
                    WebOptionPane.showConfirmDialog(loginForm, "confirm", "confirm", WebOptionPane.YES_NO_OPTION);
                }));

                loginForm.setSize ( 500, 500 );
                loginForm.setLocationRelativeTo ( null );
                loginForm.setVisible ( true );
            }
        } );
    }

image

    public static void main ( String[] args )
    {
        SwingTest.run (new Runnable ()
        {
            public void run ()
            {
                NativeFonts.setUseNativeFonts ( false );
                WebLookAndFeel.install();

                final WebDialog loginForm = new WebDialog ( StyleId.dialogDecorated, (Window) null, "Sample dialog" );

                loginForm.getContentPane().add(new WebButton("Press me", (e) ->
                {
                    WebOptionPane.showConfirmDialog(loginForm, "confirm", "confirm", WebOptionPane.YES_NO_OPTION);
                }));

                loginForm.setSize ( 500, 500 );
                loginForm.setLocationRelativeTo ( null );
                loginForm.setVisible ( true );
            }
        } );
    }

image

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions