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

When resizing a JFrame window, the window will sieze and stop resizing.

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Machine #1, test case runs fine (Java 8)
      -------------------------------
      Windows 10 Pro, Version 1803, OS Build 17134.81
      java version "1.8.0_171"


      Machine #2, test case fails (Java 10)
      ---------------------------
      Windows 10 Home, Version 1803, OS Build 17134.81
      java version "10.0.1" 2018-04-17
      installed from: jdk-10.0.1_windows-x64_bin.exe, SHA256 checks OK, separate download from machine #3


      Machine #3, test case fails (Java 10)
      ---------------------------
      Windows 10 Pro, Version 1803, OS Build 17134.81
      java version "10.0.1" 2018-04-17
      installed from: jdk-10.0.1_windows-x64_bin.exe, SHA256 checks OK, separate download from machine #2


      Machine #3, test case fails (Java 11)
      ---------------------------
      Windows 10 Pro, Version 1803, OS Build 17134.81
      java version 11-ea+15
      installed from: jdk-11-ea+15_windows-x64_bin.exe, SHA256 checks OK

      A DESCRIPTION OF THE PROBLEM :
      When resizing a JFrame window by dragging a side or corner, the window will suddenly freeze can cannot be resized any more. Also, after seizing, you cannot drag the window to a new position when you attempt a mouse drag on the title bar.
      *
      Code for a simple test case is appended. The test case runs fine under Java 8, but fails under Java 10 and a recent build of Java 11.
      *
      OBSERVATIONS
      (1) Use of EventQueue in the source code constructor was to follow common practice of having a separate thread for the swing GUI. You can replace the body of the constructor with the single following line and the problem remains:
      new TestWin3();
      (2) I grabbed the lower right corner of the test case window with the mouse pointer and wiggled the corner in a circle, diagonally, and vertically/horizontally. After a few seconds of vigorous wiggling, the window seized.
      (3) A more "complex" window seems to seize sooner. My original program had a complex GUI, and it would seize (under Java 10 & 11) with a simple slow drag to resize. In contrast, you can remove the 3 rows of GUI components - the JButton, JCheckBox, and JRadioButton lines - to make it "simple" and the window will still seize upon resizing, but it seems to take longer to do so.

      REGRESSION : Last worked in version 8u171

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile the test code: javac TestWin3.java
      Run the test code: java TestWin3
      Grab the lower right corner of the test case window with the mouse pointer and wiggle the corner in a circle, diagonally, and vertically/horizontally. After a few seconds of vigorous wiggling, the window will seize.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The window should re-size under Java 10 & 11 as it does under java 8.
      ACTUAL -
      Window stops resizing and, also, you can no longer drag the window using the title bar

      ---------- BEGIN SOURCE ----------
      // TestWin3.java

      import javax.swing.*; // JFrame, etc
      import java.awt.*; // EventQueue, etc

      public class TestWin3 extends JFrame
      {
      // === main() to start ===
      public static void main(String[] args)
      {
      // mumbo-jumbo to do Swing threads right....
      EventQueue.invokeLater(new Runnable()
      {
      public void run()
      {
      new TestWin3();
      }
      });
      }
      // === END main() ===

      // === constructor ===
      public TestWin3()
      {
      int rows = 3;
      int cols = 5;
      setLayout(new GridLayout(rows, cols));

      //row 0
      JPanel row0Panel = new JPanel();
      for (int i = 0; i < cols; i++)
      {
      row0Panel.add(new JButton("button " + i));
      }
      add(row0Panel);

      //row 1
      JPanel row1Panel = new JPanel();
      for (int i = 0; i < cols; i++)
      {
      row1Panel.add(new JCheckBox("check " + i));
      }
      add(row1Panel);

      //row 2
      JPanel row2Panel = new JPanel();
      for (int i = 0; i < cols; i++)
      {
      row2Panel.add(new JRadioButton("radio " + i));
      }
      add(row2Panel);

      setTitle("TestWin3");
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      pack();
      setVisible(true);
      }
      // === END constructor ===
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround found.

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: