Rendering problem when setting ChoiceBox items with a service

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 7u10
    • Component/s: javafx
    • None
    • Environment:

      1.7.0_10-ea-b15 on Windows 7 64bit

      I'm trying to prepare some examples to show various FX features when I came across this strange issue. I'm using a javafx.concurrent.Service to populate the items of a ChoiceBox. When I click the ChoiceBox to show the list of choices I only get an empty rectangle with a triangle drawn on top. It's only when I click on the triangle that the ChoiceBox gets redrawn properly. From what I could see in the debugger is that the items are there at the time when I click the ChoiceBox.

      {code:title=Example2App.java|borderStyle=solid}
      final ChoiceBox<String> choiceBox = new ChoiceBox();
      ExampleService service = new ExampleService();
      service.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
      @Override
      public void handle(WorkerStateEvent aEvent) {
      ObservableList<String> tempValue = (ObservableList<String>) aEvent.getSource().getValue();
      choiceBox.setItems(tempValue);
      }
      });
      service.start();
      {code}

      (PS: I could also use binding to accomplish this task but unfortunately RT-22449 prevents me from doing so.)

            Assignee:
            Parvathi Somashekar (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: