JDK-7124553 : [macosx] Need minimum size for titled Frames and JFrames
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2011-12-23
  • Updated: 2012-03-21
  • Resolved: 2012-03-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u4 b13Fixed 8Fixed
Related Reports
Relates :  
Description
http://java.net/jira/browse/MACOSX_PORT-166 submitted 2011/07/18 by ddurrence
Simple Frame or JFrame fails to draw unless one or more components are added and pack is called.
Compile and run one of the following simple test cases:
import javax.swing.JButton;
import javax.swing.JFrame;
public class SimpleJFrame
{
    public static void main(String[] args)
    {        JFrame frame = new JFrame("Boom!");        /* For the JFrame to show, it must have real content and pack must be called.           Uncomment the following two lines to have the frame draw on screen.         */        //        frame.add(new JButton("Bogus Button"));//        frame.pack();        frame.setVisible(true);    }}
— OR —
import java.awt.Frame;
import java.awt.Button;
public class SimpleFrame
{
    public static void main(String[] args)
    {        Frame frame = new Frame("Boom!");        /* For the Frame to show, it must have real content and pack must be called.         Uncomment the following two lines to have the frame draw on screen.         */        //        frame.add(new Button("Bogus Button"));//        frame.pack();        frame.setVisible(true);    }}

Comments
EVALUATION The size used for setBounds() and setMinMaxSize() operations must be constrained to always include the size of window decorations and the grow box when they're enabled. The size of (1, 1) is considered as the smallest possible size for a window in any case. Sent for review: http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-February/003101.html
15-02-2012

EVALUATION Calling pack() for an empty frame is meaningless. We assume that the majority of user applications don't do that. It must be a really rare situation when an application wants to display a frame w/o any components. Therefore we consider this issue should have very low impact.
08-02-2012