JDK-4325115 : Solaris: multiple problems with Frame.setResizable()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: solaris_7
  • CPU: generic
  • Submitted: 2000-03-27
  • Updated: 2021-07-13
Related Reports
Relates :  
Relates :  
Description

Name: dsC76792			Date: 03/27/2000

###@###.###

1.setResizable(false) doesn't make frames non-resizable.
  Frames are always resizable. (Only Enlightenment WM)
2.After setResizable(false) frames are unnecessarily remapped 
  after each programmatic reshape. (E and CDE)
3.setResizable() call on an iconified frame deiconifies it,
  but doesn't change resizability. (E and CDE)
4.After setResizable() call all child windows of the frame become 
  unmapped. (CDE)
5.After a setResizable(false) call on a maximized frame you cannot 
  resize it by dragging its border but you can unmaximize the frame 
  restoring its original size. After that if you try to resize by 
  dragging the frame's border its size jumps to the maximized size 
  and cannot be changed anymore. (All tested WMs except E)
6.If the following sequence of actions is applied to a frame:
	setVisible(false);
	setState(Frame.ICONIFIED);
	setVisible(true);
	setState(Frame.NORMAL);
  Calling setResizable() will iconify the frame. (Only E).

I tested cde, openwin, olwm, olvwm, fvwm95, wmaker, enlightenment.
 
The following test case demonstrates these problems: 
----------------------------------------
import java.awt.*;
import java.awt.event.*;

public class Test extends WindowAdapter implements ActionListener, 
                                                   ItemListener {

    final Frame controlFrame = new Frame("Control Frame");
    final Frame testFrame = new Frame("Test Frame");
    final Checkbox rCheckbox = new Checkbox("Resizable", true);
    final Checkbox iCheckbox = new Checkbox("Iconic", false);
    final Checkbox vCheckbox = new Checkbox("Visible", true);
    final Button button = new Button("Resize");

    public static void main(String[] args) {
        Test test = new Test();
    }

    public Test() {
        rCheckbox.addItemListener(this);
        iCheckbox.addItemListener(this);
        vCheckbox.addItemListener(this);
        button.addActionListener(this);

        controlFrame.setLayout(new GridLayout(4, 1));
        controlFrame.add(rCheckbox);
        controlFrame.add(iCheckbox);
        controlFrame.add(vCheckbox);
        controlFrame.add(button);
        controlFrame.pack();
        controlFrame.addWindowListener(this);
        controlFrame.setVisible(true);

        testFrame.setBounds(200, 200, 200, 200);
        testFrame.addWindowListener(this);
        testFrame.setVisible(true);
    }

    public void windowOpened(WindowEvent e) {
        System.err.println(e);
    }

    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }

    public void windowIconified(WindowEvent e) {
        iCheckbox.setState(true);
        System.err.println(e);
    }

    public void windowDeiconified(WindowEvent e) {
        iCheckbox.setState(false);
        System.err.println(e);
    }

    public void actionPerformed(ActionEvent e) {
        Dimension d = testFrame.getSize();
        testFrame.setSize(d.width + 10, d.height + 10);
        testFrame.validate();
    }

    public void itemStateChanged(ItemEvent e) {
        if (e.getSource() == rCheckbox) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                testFrame.setResizable(true);
            } else {
                testFrame.setResizable(false);
            }
        } else if (e.getSource() == iCheckbox) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                testFrame.setState(Frame.ICONIFIED);
            } else {
                testFrame.setState(Frame.NORMAL);
            }
        } else {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                testFrame.setVisible(true);
            } else {
                testFrame.setVisible(false);
            }
        }
    }
}
----------------------------------------
 
======================================================================

Comments
WORK AROUND Name: dsC76792 Date: 03/27/2000 ======================================================================
17-09-2004

EVALUATION Commit to fix in Kestrel-Solaris and Merlin. eric.hawkes@eng 2000-03-27 This bug has been partially fixed in Merlin (putback on April 11, 2000) by ###@###.###. I believe the first three problems were fixed. eric.hawkes@eng 2000-11-13
27-03-2000