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

Solaris: zoomed frame doesn't restore to normal state.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 1.4.0
    • client-libs
    • None
    • generic, sparc
    • solaris_7



      Name: dsR10078 Date: 06/07/2000

      ###@###.###

      The following test reproduces the problem:
      --------------------------------------------------------
      import java.awt.*;
      import java.awt.event.*;

      public class ZoomTest implements ActionListener {

          final Frame frame = new Frame();
          final Button button = new Button("Change state");

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

          public ZoomTest() {
              button.addActionListener(this);
              frame.setLayout(new FlowLayout());
              frame.add(button);
              frame.pack();
              frame.setVisible(true);
          }

          public void actionPerformed(ActionEvent e) {
              if (frame.getState() == Frame.NORMAL) {
                  frame.setState(Frame.ZOOMED);
                  if (frame.getState() != Frame.ZOOMED) {
                      throw new RuntimeException("Frame state is not ZOOMED.");
                  }
              } else {
                  frame.setState(Frame.NORMAL);
                  if (frame.getState() != Frame.NORMAL) {
                      throw new RuntimeException("Frame state is not NORMAL.");
                  }
              }
          }
      }
      --------------------------------------------------------

      Run the test case.
      A frame in the NORMAL state appears.
      Press "Change state" button.
      The frame gets zoomed, but getState() doesn't return ZOOMED.
      Press "Change state" button again.
      The frame size doesn't change and getState() doesn't return NORMAL.

      Here is the output:
      -------------------------------------------------------
      <das@aldebaran(pts/3).314> /set/java/jdk1.4/x86/bin/java -version
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b16)
      Classic VM (build 1.4.0beta-b16, native threads, nojit)
      <das@aldebaran(pts/3).315> /set/java/jdk1.4/x86/bin/java ZoomTest
      Exception occurred during event dispatching:
      java.lang.RuntimeException: Frame state is not ZOOMED.
              at ZoomTest.actionPerformed(ZoomTest.java:25)
              at java.awt.Button.processActionEvent(Button.java:329)
              at java.awt.Button.processEvent(Button.java:302)
              at java.awt.Component.dispatchEventImpl(Component.java:2698)
              at java.awt.Component.dispatchEvent(Component.java:2602)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:355)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:127)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:117)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:96)
      Exception occurred during event dispatching:
      java.lang.RuntimeException: Frame state is not NORMAL.
              at ZoomTest.actionPerformed(ZoomTest.java:30)
              at java.awt.Button.processActionEvent(Button.java:329)
              at java.awt.Button.processEvent(Button.java:302)
              at java.awt.Component.dispatchEventImpl(Component.java:2698)
              at java.awt.Component.dispatchEvent(Component.java:2602)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:355)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:127)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:117)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:96)
      -------------------------------------------------------
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: