Thank you for your answer and explanation.

As I understand the problem is not in using the type of the consructor, but in 
the initial color (from palette or not):

        ColorPicker picker = new ColorPicker();
        picker.setValue(Color.YELLOW);//this works OK, the color from palette
        picker.setValue(Color.CORAL);//this doesn't work, the color not from 
palette

Best regards, Pavel

On 5/9/24 6:18 PM, Andy Goryachev wrote:

Perhaps I should have left a clearer note.  The bug is still there, no one 
worked on it yet.

Changing to the default constructor at least works as expected - the large 
white square (selected color) appears over the right spot.  In the original 
example, the Color.CORAL is apparently not a part of the palette, so instead 
the white (incorrect) square appears at the wrong place.  Change the 
constructor argument to a color which is present in the palette and it would 
work as expected.  This is just a workaround, the bug is still there.

-andy

*From: *openjfx-dev <openjfx-dev-r...@openjdk.org> on behalf of PavelTurk 
<pavelturk2...@gmail.com>
*Date: *Thursday, May 9, 2024 at 07:56
*To: *openjfx-dev@openjdk.org <openjfx-dev@openjdk.org>
*Subject: *There is no workaround for JDK-8324327

Hello all.

This is about https://bugs.openjdk.org/browse/JDK-8324327 
<https://bugs.openjdk.org/browse/JDK-8324327> .

Andy Goryachev wrote in comment "Change to the default constructor and the issue 
disappears".
I don't see that using default constructor solves the problem. I tried the 
following code :

public class JavaFxTest7 extends Application {

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

     @Override
     public void start(Stage primaryStage) {
         VBox root = new VBox();
         ColorPicker picker = new ColorPicker();
         root.getChildren().addAll(picker);

         var scene = new Scene(root, 400, 300);
         primaryStage.setScene(scene);
         primaryStage.show();
     }
}

and I have the same bug.

JavaFX: 23-ea+3
Java: 21.0.2
OS: Ubuntu 20.04.3 LTS

So, ColorPicker is always broken.

Best regards, Pavel


Reply via email to