Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4178494

Min/Max buttons not created with Frame and JFrame when not resizable

XMLWordPrintable

    • b01
    • x86
    • windows_95, windows_nt

        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

              tmasunw Tao Ma (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: