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

Java Statically Determines Display Size on Linux platforms

    XMLWordPrintable

Details

    • b17
    • x86
    • linux

    Description

      SYNOPSIS
      --------
      Java Statically Determines Display Size on Linux platforms

      OPERATING SYSTEM
      ----------------
      Linux (tested on RHEL)

      JDK VERSION
      -----------
      Reproducible with JDK 6u25
      Reproducible with JDK 7b142

      PROBLEM DESCRIPTION
      -------------------
      java.awt.Toolkit provides a getScreenSize() method that returns a java.awt.Dimension. The width and height of that Dimension are always the desktop resolution at the time the JVM is started. If the resolution changes while the JVM is running, the values in Dimension returned from getScreenSize() do not change.
                                               
      java.awt.DisplayMode exhibits similar behavior. It provides a getWidth() method and getHeight() and the values do not change after a desktop resolution change.

      REPRODUCTION INSTRUCTIONS
      -------------------------
      Testcases are attached.

      Example Problem 1:
      1. javac -d popup *.java
      2. java popup.GE
      3. Click 'Print Graphics info' to display current java graphics
         information including display width and height.
      4. Change dispaly screen resolution.
      5. Click 'Print Graphics info'again. It can be noticed that the graphics
         information displayed are not having updated display width and
         height.

      Example Problem 2:
      1. Change screen resolution to some lower value (say 1920x1200)
      2. java popup.GE
      3. PopupTest displays another window with a button. The button will
         display a JPopupMenu above the button when clicked.
      4. Change screen resolution to some higher value (say 5760x1200).
      5. Move the window past 1920, then click the button again. The popup
         menu wont paint past 1920 so it appears to float to the left of the
         window.

      Attachments

        Issue Links

          Activity

            People

              anthony Anthony Petrov (Inactive)
              dkorbel David Korbel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: