1

This code:

package colorpickertest;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ColorPicker;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class ColorPickerTest extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        Pane root = new Pane();
        Scene scene = new Scene(root, 640, 480, Color.BLACK);
        root.getChildren().add(new ColorPicker());

        stage.setTitle("ColorPickerTest");
        stage.setScene(scene);
        stage.show();
    }

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

}

sometimes gives this error repeatedly when certain lighter colors are picked:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at com.sun.glass.ui.TouchInputSupport.notifyBeginTouchEvent(TouchInputSupport.java:82)
    at com.sun.glass.ui.mac.MacTouchInputSupport.notifyNextTouchEvent(MacTouchInputSupport.java:128)
    at com.sun.glass.ui.mac.MacGestureSupport.notifyNextTouchEvent(MacGestureSupport.java:77)

What am I doing wrong? Thanks. StackOverflow is making me add more details but this is all I have to offer.

4
  • Hi, i tried this but could not reproduce this behavior. What JavaFX 8 build are you using(System.out.println(com.sun.javafx.runtime.VersionInfo.getRuntimeVersion()); to check); i currently use 8.0.0-b132 Apr 8, 2014 at 8:12
  • This stacktrace seems like an OS specific thing that has not be fixed yet. I am on windows and got an ArrayIndexOutOfBoundsException. Apr 8, 2014 at 8:14
  • I have version 8.0.20-ea-b05. Are you saying you did get an error with the same code though? I'm on a Mac.
    – Alex Varga
    Apr 8, 2014 at 18:16
  • Yes i copied it and got an ArrayIndexOutOfBoundException - but only if i dragged the mouse over the picker. As there are exacly ZERO others encountering the same problem I'd just catch it and see if its fixed in an upcoming version of JFX Apr 8, 2014 at 20:40

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.