JDK-4178494 : Min/Max buttons not created with Frame and JFrame when not resizable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.7,1.2.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_95,windows_nt
  • CPU: x86
  • Submitted: 1998-10-02
  • Updated: 1999-11-22
  • Resolved: 1998-12-16
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.
Other Other Other
1.1.7 b01Fixed 1.1.8Fixed 1.2.1_002Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
import java.awt.*;
import java.awt.event.*;

public class CantMinMax extends Frame {

    public static void main(String args[]) {
        CantMinMax cantMinMax = new CantMinMax();
    }

    public CantMinMax () {
        addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {System.exit(0);}});
        setTitle("Can't Min/Max in JDK 1.1.7");
        setSize(300,150);
        setResizable(false);
        show();
    }
}
_______________________________________
This code demonstrates a problem where min/max buttons do not appear on a Frame which is not resizable.  If the code is modified in the following way:

    public CantMinMax () {
        addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {System.exit(0);}});
        setTitle("Can't Min/Max in JDK 1.1.7");
        setSize(300,150);
        show();
        setResizable(false);
    }

The frame is not shown onscreen at all.  Since Frames and JFrames in 1.1.6 had min/max buttons, the customer expects this code to work.

elizabeth.mezias@Eng 1998-10-02

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.1.8 FIXED IN: 1.1.7b_001 1.1.8 1.2.1-002 INTEGRATED IN: 1.1.7b_001 1.1.8 1.2.1-002 VERIFIED IN: 1.1.8
14-06-2004

EVALUATION cannot verify the bug, no regression test provided. tao.zhang@eng 1999-03-01 Comitting to 1.1.8. lara.bunni@Eng 1998-10-02 The removal of the min/max buttons for non-resizable frames was done on purpose, since frame's shouldn't be sizable at all in this case. In 20/20 hindsight however, the minimize button shouldn't have been removed, since that's not really a sizing operation like maximize. However, another consideration was the on Motif, a non-resizable frame has neither button. So really, the thing to do is have non-resizable frames on both platforms have minimize buttons. Unfortunately there is not enough time to get this into the 1.1.7 update. robi.khan@eng 1998-10-05 there is a duplicate of this bug: 4172782: Frame.setResizable(false) prevents frame being minimized and xianfa@eng has already done putback for 1.2.2. so i will close this one as duplicate of 4172782. tao.ma@Eng 1999-01-22 the same fix has been put back with bug 4172782, because i can't close this one as duplicate, i mark it as "integrated in 1.2.2" tao.ma@Eng 1999-02-10 Instead of marking the bug "integrated in 1.2.2", I'm marking it as a dotdot-only bug. This will keep it off the relevant tracking lists. david.mendenhall@eng 1999-02-10
10-02-1999

SUGGESTED FIX ------- awt_util.h ------- *** /tmp/da007B6 Wed Dec 31 16:00:00 1969 --- awt_util.h Tue Oct 27 10:35:25 1998 *************** *** 27,34 **** #define AWT_MWM_RESIZABLE_DECOR MWM_DECOR_ALL #define AWT_MWM_RESIZABLE_FUNC MWM_FUNC_ALL ! #define AWT_MWM_NONRESIZABLE_DECOR (MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MENU) ! #define AWT_MWM_NONRESIZABLE_FUNC (MWM_FUNC_MOVE | MWM_FUNC_CLOSE) void awt_util_setShellResizable(Widget shellW, Boolean isMapped); void awt_util_setShellNotResizable(Widget shellW, long width, long height, Boolean isMapped); --- 27,36 ---- #define AWT_MWM_RESIZABLE_DECOR MWM_DECOR_ALL #define AWT_MWM_RESIZABLE_FUNC MWM_FUNC_ALL ! #define AWT_MWM_NONRESIZABLE_DECOR (MWM_DECOR_BORDER | MWM_DECOR_TITLE |! MWM_DECOR_MENU | MWM_DECOR_MINIMIZE) ! #define AWT_MWM_NONRESIZABLE_FUNC (MWM_FUNC_MOVE | MWM_FUNC_CLOSE |! MWM_FUNC_MINIMIZE) void awt_util_setShellResizable(Widget shellW, Boolean isMapped); void awt_util_setShellNotResizable(Widget shellW, long width, long height, Boolean isMapped); ------- awt_Window.cpp ------- *** /tmp/da007Ay Wed Dec 31 16:00:00 1969 --- awt_Window.cpp Tue Oct 27 13:59:13 1998 *************** *** 539,545 **** return; } long style = GetStyle(); ! static const long SizeStyles = WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX; if (isResizable) { style |= SizeStyles; --- 539,545 ---- return; } long style = GetStyle(); ! static const long SizeStyles = WS_THICKFRAME|WS_MAXIMIZEBOX; if (isResizable) { style |= SizeStyles; tao.ma@Eng 1998-12-01 The above fix was code reviewd by Mike Bronson for 1.1.8 putback. patrick.ong@Eng 1998-12-16
01-12-1998