Rendering problem when setting ChoiceBox elements with a service

I am preparing some examples to show the various features of FX when I came across this strange issue. I use a javafx.concurrent.Service to populate the items of a ChoiceBox. When I click the ChoiceBox to display a list of choices, I get only a blank rectangle with a triangle drawn on top. It's only when I click on the triangle the ChoiceBox gets correctly redrawn. From what I could see in the debugger is that the elements are there at the time when I click on the ChoiceBox.
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();
Screenshot: [url https://dl.dropbox.com/u/8978331/ChoiceBoxRenderingProblem.png] https://dl.dropbox.com/u/8978331/ChoiceBoxRenderingProblem.png
Code example: [url https://dl.dropbox.com/u/8978331/Example2App.java] https://dl.dropbox.com/u/8978331/Example2App.java

I'll write a Jira issue for this one, or is it my fault?

I use 1.7.0_10 - ea - b13 on Windows 7 64 bit, but same problem occurs on Mac OS X.

(PS: I could also use binding to accomplish this task, but unfortunately the RT-22449 prevents me to do).

Published by: Thilo 13 November 2012 10:57 to repair broken links

Looks like a bug to me. It is not related to the use of a service (or multithreading): the code below suffers from the same issue.

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class ChoiceBoxTest extends Application {

  @Override
  public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("Example 3");

    final ChoiceBox choiceBox = new ChoiceBox<>();
    final Button populateButton = new Button("Populate");
    populateButton.setOnAction(new EventHandler() {

      @Override
      public void handle(ActionEvent event) {
        ObservableList tempValue = FXCollections.observableArrayList();
        for (int i = 0; i < 10; i++) {
          tempValue.add("Item " + i);
        }
        choiceBox.setItems(tempValue);
        // This will work:
        // choiceBox.getItems().setAll(tempValue);
      }

    });

    VBox root = new VBox();
    root.getChildren().addAll(populateButton, choiceBox);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
  }

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

}

To work around this problem, replace

choiceBox.setItems(tempValue);

with

choiceBox.getItems().setAll(tempValue);

Tags: Java

Similar Questions

  • A problem when using Flash files with a browser

    Hello

    I have this weird problem when it comes to the use of flash in dreamweaver, whenever I use a flash file & after I test it on Both Firefox & IE browser), I get this weird border whenever I click on it, and here's a photo shows u what I mean...Flash_Border.jpg

    If all goes well. I'll take a few answers:

    Thanks in advance.

    Try adding the following (in red) to the style of the web page and see if it helps...

  • display problem when start my Mac with Sierra

    When my MacBook Pro 13 with the retina display changes to another other than 1280 x 720 resolution, when I boot my Mac, there will be a white strip above the logo apple with flash on the screen... Is there a solution?

    Hello fish6,

    After reviewing your post, it sounds like you have problems with the resolution of the screen changes and the screen flashes.
    I would recommend you read this article, reset the NVRAM can help with the screen problems you encounter.

    How to reset the NVRAM on your Mac - Apple Support

    Thank you for using communities of Apple Support. Good day.

  • Problem when creating a report with a date of schduled

    When I tried to create a report with a schedule (any option except now) I get the error 'Date of the first report occur must be after or equal to the current date", unless I have use a date of 01-10-2012 or later in the first report occurs on the field.  Current date is 2012-08-23.

    Let me know if you can recreate it and if or when there is a fix.

    Hi Tim,.

    We have fixed the problem now. Could you please check that you are able to schedule a report now with start date of today?

    Thank you

    The OnPlus team

  • How can I remove a (problem when setting up a Repeater) network extension

    Hello

    When I tried to installed a Repeater (TP-Link, TL-WA901ND) of my iMac, it did not.

    But since then, my wifi name double in the list. And none of these two works...

    We installed the Repeater from a different computer, but now I'm the only person who is not able to connect to the network that we share. Probably due to mishandling, I did when I tried to install the Repeater of my imac...

    Do you know how it is possible to remove only the two networks of my system / list and restart from the beginning?

    Thanks a lot for your help!

    Have you tried to reboot your router with the Repeater of the dead fire? Or if all else fails then reset your router to the default settings, and then start over completely.

  • Windows Live mail problem when sending an email with picture multiple attachments (.jpg)

    Last week, I sent an email with attachments of two photo. This was not enough and I got 5 separate messages, advising me of non-delivery, but also the original message had not been saved in my "sent" folder

    Today, I sent two e-mails with multiple attachments photos and the recipient received the first email 46 times but with only the subject line, no message and no attachments. He received the second e-mail 26 times again with only the subject line (this one not included in my folder "sent" Although previous email did).

    The recipient today is different from the one I sent last week.

    All other messages recently, including those with no photographic attachments seem to have been given normally and are displayed in my "sent" folder Some recipients responded to these so I know they arrived OK.

    Any ideas on what is causing the problem and how to solve this problem?

    Right click on the name of the account above the Inbox. Properties | Advanced and uncheck 'Break apart messages... ". ». That will solve the multiple copies with no photo.

  • Problem when setting brightness of the screen in Windows 8.

    I use Windows 8 Pro.

    System Specs:
    * HCL ME laptop, series 1114
    Description: I can't adjust the brightness of the screen, I tried to use the keyboard shortcuts provided as well as the power options in the Control Panel, but no effect. The cursor goes to 0, but the brightness of the screen remains the same.

    The problem is with the INTEL HD graphics driver that you have downloaded from the site Web HCL. However on the installation he States, it is compatible with Win8 but in fact, it is not.

    The same problem is faced with one of my friends on the same model HCL 1114.
    I suggest you go ahead with the value by default WIndows and uninstall the Intel HD Graphics driver
    Graphics driver and everything works perfectly.
    Referring to Intel Driver download section they distribute the library to OEM (HCL) may be you
    should try in the near future to obtain the effective execution of the Intel HD graphics driver
  • OIM 11 g R2-problem when setting up field of IOM in weblogic

    Hello

    I try to install the version of OIM 11 g R2 and downloaded the full costume of the delivery site.
    Oracle DB version: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    Others such as Weblogic, UCR and IdM suite versions are 11g R2 downloaded from the delivery site

    When I try to configure the domain for IOM in weblogic, getting the exception below, which returns no rows

    Component schema = schema of IOM
    Driver = Oracle.JDBC.OracleDriver
    URL=JDBC:Oracle:thin:@localhost:1521/ORCL
    User = DEV5_OIM
    Password = *.
    Test SQL = select 1 from schema_version_registry where owner = (select use double) and mr_type = 'IOM' and release = '11.1.2.0.0'

    * CFGFWK-60850: Test failed! **
    * CFGFWK-60853: a connection to the database, but no lines have been returned since the test SQL statement.* *.

    Hello

    It is likely that you need to install/upgrade to update the schema of IOM with the remote control. His research on the status of the (where version = 11.1.2.0.0) Although this is not find version

    -Which IOM schema is installed?
    http://App-Security.blogspot.com/2012/01/quick-OIM-tip-finding-out-OIM-version.html

    Kind regards
    Daniel

  • Error problem when installing Photoshop elements 12

    I got the combo of Adobe Photoshop elements 12 and first elements 12 pack this Christmas. I started to install the cd on my computer and entered the serial number for Photoshop. Midway during the installation of Photoshop elements 12, my computer froze. I canceled the installation and rebooted my computer. When I tried to reinstall Photoshop, I get error application of transformations. Please check the special changes paths are valid.

    I tried to install the 12 elements of first and it installed fine. I can't get the part of Photoshop Elements to work. What can I do to remedy this? Thanks for any help!

    If you are using win 7, http://support.microsoft.com/mats/Program_Install_and_Uninstall

  • Rendering problems when publishing to SWF, MP4 format

    A part of my screen Capture look like this:

    img1.png

    The image appears well within Captivate 5, 5.5 or 6 (6.0.1.240) (on Windows 7). However, when I preview the project in one of the versions of the said or publish to SWF format or mp4, the colors white and yellowish alternation table are not preserved:

    img2.png

    In addition, the yellowish area in some slides will creep on in other sections of the published output (notice that the image above is only a part of the whole capture zone). These problems occur not in the output HTML 5, but I have to be able to output mp4. And I don't think really profesional is to have images of the software to make me do a simulation under par.

    The problem does not occur in sections of full-motion, and the difference makes this more noticeable problem. I checked out some of my old projects (probably made in Captivate 4 or more) and this problem did not exist.

    I tried record 16 - bit and 32-bit color mode options, by disabling the compression by advanced project, percentage, do not compress the SWF, strength to change the JPEG republish and nothing has helped.

    Thank you

    Jacob

    That slide quality do you use? If it is low, replace optimized. It is the first proposal, the only one, you don't mention. Sorry if you tried that as well.

    16-bit/32-bit is for demo Full Motion recording or HD video, but I think you're talking about normal capture workflow.

    Lilybiri

  • Problem when setting the option of delay in delivery on JMS

    Hi, I am trying to set the option of delay in delivery over JMS, but it does not work. For this I used the following code:

    Private Sub queuing (message from InterfaceMessage, int priority, Boolean isLog) {}
    QueueConnection queueConnection = null;
    WLQueueSession wlQueueSession = null;
    WLMessageProducer wlMessageProducer = null;
    ObjectMessage, objectMessage = null;
    delay = 5000;
    try int = 5;
    try {}
    queueConnection = connectionFactory.createConnection () (QueueConnection);
    wlQueueSession = (WLQueueSession) queueConnection.createQueueSession (false, Session.AUTO_ACKNOWLEDGE);

    Logger.info ("\tMessageManager.queuing--> FRONT RedeliveryDelay: {} - delay: {}", wlQueueSession.getRedeliveryDelay (), delay); * //Here the newspaper prints 0 - 5000 *.
    wlQueueSession.setRedeliveryDelay (delay);
    Logger.info ("\tMessageManager.queuing--> AFTER RedeliveryDelay: {} - delay: {}", wlQueueSession.getRedeliveryDelay (), delay); * //But here, the newspaper prints still 0 - 5000, instead of 5000-5000 then why is the value set is not respected? *

    wlMessageProducer = wlQueueSession.createProducer (interfaceEXPRESSMessage) (WLMessageProducer);
    wlMessageProducer.setRedeliveryLimit (attempts);
    objectMessage = wlQueueSession.createObjectMessage (message);
    wlMessageProducer.send (objectMessage);
    } catch (Exception exception) {}
    Logger.Error ("MessageManager.queuing-> Exception - msg: {}", objectMessage, exception);
    } {Finally
    try {}
    wlMessageProducer.close ();
    wlQueueSession.close ();
    queueConnection.close ();
    } catch (Exception exception) {}
    Logger.Error ("MessageManager.queuing-> Exception - msg: {}", objectMessage, exception);
    }
    }
    }

    Could someone advise on how to fix this?

    Thanks in advance!

    Published by: cbustamante on April 29, 2011 10:54

    Configuration of the period of delivery and return limit can also be set programmatically (using WLST script or java mbeans), so if these settings change infrequently – say once a day – then mbeans could be a good approach...

    Can you explain more about what you are looking for? Your original question was late redelivery, no delivery deadline. It looks like delivery limits can be set for producers - as directed by the javadoc I mentioned above, and delays can be set on the sessions of consumers (no effect on the producers from the same session).

    An MDB does not provide users with access to the session of the container used to create internal consumption.

    Tom

  • Problem when using SOAP requests with HTTP POST function

    Hello!

    Using the vi of HTTP POST to send SOAP requests to a device, I encountered a problem.

    Take care of the HTTP header for you HTTP POST vi and defines the type of 'content' as "Content-Type: application/x-www-formulaires-urlencoded. Who is considered to be 'non-soap' requests by some Web servers.

    Standards W3C says in this case, you should be content-type: "application/soap + xml".

    Link to the page to W3C standard: http://www.w3.org/TR/soap12-part0/#L26866

    That is possible to update this feature in a future release so that programmers can choose (or type) the necessary content type?

    Have you tried "Add header" to change?

    http://zone.NI.com/reference/en-XX/help/371361L-01/lvcomm/http_client_addheader/

  • Help! Problem when running CF under a default service account

    I am running ColdFusion 9 with IIS 7 on Windows Server 2008.

    The CF application service runs under a domain request account rather than the local default.

    The problem is when you are so defective models keep an indefinitely open active query.

    Is it a permission setting, I may be missing to resolve this problem?

    Thanks for any help anyone can provide.

    Charlie, thank you very much for your answer.

    We had only to read/write permissions for the account on the coldfusion9 directory. After changing to full control, the problem has been resolved.  Charlie, thank you very much for your answer.

  • How to transfer the text value of the element with the character of new line between pages?

    Hello

    I use the Application Express 4.2.2.00.11 on the 11g XE database. In my application, I use the transfer of certain values deposited between pages on a lot of places in my application. But now I have a specific problem with a textarea element.

    I have the page with the textarea element and I transfer element value to another page using the link button. I use "Set these elements" "with these values" mechanism.

    Everything works fine until I try to add the new line character in the area of the text box to be transferred to another page. I get this error message when I try

    Contact your administrator for the application. The checksum calculated on the basis of the application, clear the cache, names of arguments and argument values (711P711_TEXTabc CRC [A55D4D4B325E23CB83EF28FB7671E8F0]) does not match the checksum passed to the procedure of show (23CC724ADDA630B6F3BDFD2FEE1498E0). Note: users receive a different error message.

    Transfer of value to another implementation of page when I 'abc cde' in the text box.

    Transfer of value to another page do not work when I 'abc [line break] cde' in the text box.

    Value of transfer with the new line character point works when I change "Arguments must have checksum" "Unrestricted" on the landing page. But I want to use the shared services provider and do not want to disable checksum calculation.

    It seems that there is a bug in the function of calculation of sum of internal control...

    You have some tips?

    Cardel wrote:

    I use the Application Express 4.2.2.00.11 on the 11g XE database. In my application, I use the transfer of certain values deposited between pages on a lot of places in my application. But now I have a specific problem with a textarea element.

    I have the page with the textarea element and I transfer element value to another page using the link button. I use "Set these elements" "with these values" mechanism.

    Everything works fine until I try to add the new line character in the area of the text box to be transferred to another page. I get this error message when I try

    Contact your administrator for the application. The checksum calculated on the basis of the application, clear the cache, names of arguments and argument values (711P711_TEXTabc CRC [A55D4D4B325E23CB83EF28FB7671E8F0]) does not match the checksum passed to the procedure of show (23CC724ADDA630B6F3BDFD2FEE1498E0). Note: users receive a different error message.

    Transfer of value to another implementation of page when I 'abc cde' in the text box.

    Transfer of value to another page do not work when I 'abc [line break] cde' in the text box.

    Value of transfer with the new line character point works when I change "Arguments must have checksum" "Unrestricted" on the landing page. But I want to use the shared services provider and do not want to disable checksum calculation.

    It seems that there is a bug in the function of calculation of sum of internal control...

    You have some tips?

    This is one of the many reasons why it is inappropriate pass strings of characters between the pages through the URL. Instead of using a redirect button, change the button to send the page, then use the conditional calculations to set the values on the landing page and finally access the page using a conditional on submit: before Validation: (after calculation and before Validation and treatment) branch. When you press button terms of use on the calculations and the direction.

  • Branch to the Page identified by the element with parameters

    A certain page we originally had a 'branch at or the Page URL' that has parameters associated with it (which one who reset the element on the page the branch goes back to the current value of the item page before branching him given that this necessary element to stay with the current value of population but was erased when he branched out) but now I have a new Application process that defines an element of the request for the page that should be branched to.

    Since Apex does not recognize the elements of the Application in a "branch of Page or URL", I need to create a "branch of Page identified by Item", the problem is that there is no "Set these elements" "with these values" with this type of branch or the option to include parameters in a URL target. I already tried to use the "branch Page or the URL" with the Application in the URL element, but that no longer works.

    Any suggestions on how I might branch to a page based on an element of the Application (if not this way, somehow creates a branch to a page based on a value in an application process) with the settings?

    What does not make sense to me, is that you could create a branch to a Page with a value of Page element with parameters defining the elements with certain values, but you can do this when identified by the item or it is not yet Application_Items in a Branch_to_Page/URL.

    Thank you in advance,
    -Brian

    Brian,

    Have you tried to use the Type of the branch "Branch to the Page identified by the (name of the use element) element" and put the name of your APP_ITEM like

    APP_ITEM

    ?

    This should work for you.

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

Maybe you are looking for