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

Very Small Box for JCheckBox in high DPI Monitor

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • P4
    • Resolution: Duplicate
    • 8u101
    • None
    • client-libs

    Description

      A DESCRIPTION OF THE REQUEST :
      The box beside the JCheckbox is too small in high DPI devices. It is UI manager duty to figure it out and correct it.

      JUSTIFICATION :
      The high DIP devices are getting more and more and we need to react.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Bigger box when the DIP is high.
      ACTUAL -
      It is too small to be clicked or seen

      CUSTOMER SUBMITTED WORKAROUND :
      No proper workaround, but can be easily corrected in swing source code as follow :

      javax.swing.plaf.metal.MetalIconFactory Line 1047 -> CheckBoxIcon class getControlSize method : it returns hard coded number 13 with shoulde be as follow

      protected int getControlSize() {
           return 13 * Toolkit.getDefaultToolkit().getScreenResolution() / 96;
      }

      Because 13 is appropriate for 96 DPI

      In Motif look and feel :

      com.sun.java.swing.plaf.motif.MotifIconFactory : Line 94

              final static int csize = 13;

      Should be changed to :

              final static int csize = 13 * Toolkit.getDefaultToolkit().getScreenResolution() / 96;

      In Windows look and feel :

      com.sun.java.swing.plaf.windows.WindowsIconFactory : Line 320

              final static int csize = 13;

      Should be changed to :

              final static int csize = 13 * Toolkit.getDefaultToolkit().getScreenResolution() / 96;



       

      Attachments

        Issue Links

          Activity

            People

              alexsch Alexandr Scherbatiy
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: