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

Solaris: multiple problems with Frame.setResizable()

XMLWordPrintable

    • Fix Understood
    • generic
    • solaris_7



      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);
                  }
              }
          }
      }
      ----------------------------------------
       
      ======================================================================

            Unassigned Unassigned
            dassunw Das Das (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: