harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2333) [classlib][swing] Swing title pane for JFrame, JDialog should check if window states are supported when showing buttons
Date Mon, 27 Nov 2006 12:49:23 GMT
[classlib][swing] Swing title pane for JFrame, JDialog should check if window states are supported
when showing buttons
-----------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2333
                 URL: http://issues.apache.org/jira/browse/HARMONY-2333
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Denis Kishenko
         Attachments: HARMONY-2333-actual.PNG

Swing (Metal) title pane shouldn't show buttons (Iconify, Maximize) for states
that are not supported by Toolkit.

To run the test use: java -Dawt.toolkit=MyToolkit Test

We have to check if corresponding window states are supported by the ToolKit
when adding buttons to the title pane (use Toolkit.isFrameStateSupported()).

========== Test ==================
import javax.swing.*;

public class Test {
    public static void main(String args[]) throws Exception {
        JFrame.setDefaultLookAndFeelDecorated(true);
        final JFrame f = new JFrame("FrameTest");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setBounds(250, 100, 200, 200);
        f.setVisible(true);
    }
}

===== MyToolkit ==========
public class MyToolkit extends sun.awt.windows.WToolkit {
    public boolean isFrameStateSupported(int state) {
        return false;
    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message