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

After restoring a minimized window no buttons are active including the close "X"

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux_ubuntu

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)

      Note that we are running java 1.7 for the application

      ADDITIONAL OS VERSION INFORMATION :
      3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

      Known as Ubuntu 10.04

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Configured Ubuntu 14.04 so that the Unity Window Manager is not being used. Using Gnome for windowing.

      A DESCRIPTION OF THE PROBLEM :
      I built a simple JFrame Window with one button. When running the application as a jar file the window responds to button inputs when first started. If the window is minimized and then restored the button is no longer active. Cannot move or close the window also.

      Found out that if setResizable(false) is used then this behavior happens. Without the setResizable(false) line the window works well.

      ADDITIONAL REGRESSION INFORMATION:
      It did not work for release 1.8 either. Did not check any other releases.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Make a simple one button JFrame window with a line setResizable(false). Export a jar file and run the application. Minimize the window and then restore the window.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected to have the button active on the window.
      ACTUAL -
      The button (and most other user inputs) is/(are) no longer active.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package guiSetResizable;


      // Test of a simple window that uses the setResizable(false) command


      // Imports are listed in full to show what's being used
      // could just import javax.swing.* and java.awt.* etc..

      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JComboBox;
      import javax.swing.JLabel;

      import java.awt.BorderLayout;



      public class guiSetResizable
      {
      // Note: Typically the main method will be in a
      // separate class. As this is a simple one class
      // example it's all in the one class.
      public static void main(String[] args)
      {
      new guiSetResizable();
      }


      public guiSetResizable()
      {
      JFrame guiFrame = new JFrame();

      // make sure the program exits when the frame closes
      guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      guiFrame.setTitle("Example setResizable GUI");
      guiFrame.setSize(300,250);
      // the next line may cause the window to be non-responsive after
      // the window is restored from being minimized, seen in Ubuntu 14.04
      guiFrame.setResizable(false);

      // This will center the JFrame in the middle of the screen
      guiFrame.setLocationRelativeTo(null);

      // Options for the JComboBox
      String[] fruitOptions = {"Apple", "Apricot", "Banana"
      ,"Cherry", "Date", "Kiwi", "Orange", "Pear", "Strawberry"};

      // The JPanel contains a JLabel and JCombobox
      final JPanel comboPanel = new JPanel();
      JLabel comboLbl = new JLabel("Fruits:");
      JComboBox<?> fruits = new JComboBox<Object>(fruitOptions);

      comboPanel.add(comboLbl);
      comboPanel.add(fruits);

      // The JFrame uses the BorderLayout layout manager.
      guiFrame.add(comboPanel, BorderLayout.NORTH);

      // make sure the JFrame is visible
      guiFrame.setVisible(true);
      }
      }









      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Do not use setResizable.

        Attachments

          Activity

            People

            Assignee:
            ssadetsky Semyon Sadetsky (Inactive)
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: