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

Very Small Box for JCheckBox in high DPI Monitor

XMLWordPrintable

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

      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;



       

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

              Created:
              Updated:
              Resolved: