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

ColorPicker color boxes lack DPI scaling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8u60
    • 8u45
    • javafx
    • Tested on Windows 8.1

      ColorPicker shows a box of the selected color next to the color name when closed, and a grid of standard color boxes when opened. These boxes do not scale with Windows DPI settings, meaning they are too small at any DPI setting above 100% (96 DPI).

      See these two screenshots for a demonstration:
      http://kynosarges.org/images/dpi/ColorPicker-96.png (96 DPI = 100%, boxes same size as text height)
      http://kynosarges.org/images/dpi/ColorPicker-192.png (192 DPI = 200%, boxes much smaller than text height)

      At 200% the boxes are already rather tiny, and that's the required scaling for a modern 4K display (indeed my Dell XPS 15 defaults to 250%). The screenshots were created using this simple test program:

      package org.kynosarges;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.ColorPicker;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class ColorPickerTest extends Application {

          @Override
          public void start(Stage primaryStage) {
              primaryStage.setTitle("ColorPicker Test");
              primaryStage.setScene(new Scene(new StackPane(new ColorPicker())));
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
      }

            flar Jim Graham
            cnahrjfx Christoph Nahr (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: