GUI Update stops

Hello,
i'm implementing an application, which permanently updates a TableView and a Label. This works fine in general. But sometimes updating the gui stops, for example if the application was in background and is focused again. Nothing is displayed in the application window in this case (its black or just frozen), but if i manage to find the button positions they react normally.
Did anyone experienced this before? Do you have any suggenstion?
I already tried to call Platform.runLater() less often, but that did not solve the problem.
I also added:
final EventDispatcher eventDispatcher = myScene.getEventDispatcher();  // the original dispatcher
myScene.setEventDispatcher(new EventDispatcher() {
@Override
public Event dispatchEvent(Event event, EventDispatchChain tail) {
long millis = System.currentTimeMillis();
Event returnedEvent = eventDispatcher.dispatchEvent(event, tail);  // let original one handle it as usual
millis = System.currentTimeMillis() - millis;
if(millis >= 100) {  // check if it was slow
System.out.println("[WARN] Slow Event Handling: " + millis + " ms for event: " + event);
return returnedEvent;
as suggested somewhere else in the forum. I did not get any "Warnings".

Adapting the event dispatcher is a strange thing to do.  I wouldn't recommend that.
I'm not sure why you need Platform.runLater either (you might need it, but nothing in your question indicates you do).
To get any help you will almost certainly need to provide an SSCCE.
There are a few jira bugs filed about black screens in JavaFX applications.
For example:
RT-25178 Regression: Background of controls becomes black after waking from sleep
RT-32636 All JavaFX apps stop rendering when coming out of screen lock
You can search for others at:
https://javafx-jira.kenai.com
Whether the bugs apply to your case will depend on your code, environment and what JavaFX version you are using - you will need to check and verify.

Similar Messages

  • Virtualbox GUI has stopped

    In  vista I have freshly installed archlinux as guest in virtual box
    After login I have updated pacman -Syu
    When I reboot
    at
    :: loading Hook [udev]
    :: looking Udev......SCSI subsystem initialized  At this point a pop up comes saying
    Virtual GUI has stopped woking
    But I have found in another archlinux guest if I dont upgrade, this problem doesnt happen
    I have done this exercise several times
    I feel strongly when I upgrade the whole system upgrading the kernel is causing some problem
    Can anyone suggest what to do

    Hello sant527!
    It's a known vbox issue.
    http://bbs.archlinux.org/viewtopic.php?pid=601708
    http://bbs.archlinux.org/viewtopic.php?id=77493

  • HT1926 Installation of latest  itunes update stopped, gave error message re couldn't find MSVCR80.dll. Suggested reinstall. Tried but that generated same message. Now get that message when I try to open itunes. I have Windows XP. Help!

    Installation of latest itunes update stopped, gave error message "couldn't find MSVCR80.dll"  Suggested reinstall. Tried but got same message. Now get same error message when I try to open itunes. Help!

    Hey jeight26,
    When you uninstalled and reinstalled iTunes, did you use this article?
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    If you haven't already done these steps, this section contains information that might help your situation, as the order and manner which you uninstall has an effect on the outcome:
    Use the Control Panel to uninstall iTunes and related software components in the following order and then restart your computer:
    iTunes
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Important: Uninstalling these components in a different order, or only uninstalling some of these components may have unintended affects.
    Let us know if following that article and uninstalling those components in that order helped the situation.
    Welcome to Apple Support Communities!
    Sincerely,
    Delgadoh

  • HT202157 Apple TV update stopped in step 1 of 2

    Apple TV 3 updating stopped in the 80% of step 1 of 2

    Well this happened to me to. Against the warnings I unplugged Apple TV and plugged it back in. It came back up fine. Ran software update and it downloaded and installed without an issue this time.

  • Networking with other computers after xp updates stops

    will networking with other computers  be possible , safely after xp updates stops?

    None of the functionality of Windows XP will change.  Everything you can do today you will be able to do next month.  The only thing that is different is the fact that there will no longer be updates issued for XP.  If you
    are doing ONLY internal networking with no internet access, you have nothing to worry about.  If you have internet access, then you will need to be especially certain that the anti-virus is up to date, and you have a good firewall running.
    Please do not read this sentence. Please ignore the previous sentence.

  • Making GUI update at correct time

    I'm creating an engine that can display experimental stimuli for my lab working with kids with reading disabilities. I have a GUI which can display the next stimuli in the test. Once the stimuli are displayed, the program does nothing until the user presses a button and a key event is called.
    I'm now trying to get my GUI to play recorded words to the user. Because it's the responsibility of the GUI to display stimuli, the GUI will be the one playing the sound (even though that's not typically thought of as a GUI responsibility). Unfortunately, even though the commands to update the GUI display are placed before the command to play the sound, the GUI does not update until it has finished playing the sound.
    This has nothing to do with the sound itself: if I replace the clip.play() line with a loop that wastes time and spins around for five seconds, the GUI does not update for those five seconds.
    The GUI updates itself the moment the program leaves the setStimuli() method. How can I get it to update itself before then? Commands such as this.repaint() don't appear to work.
    Any thoughts on how to get the GUI to update itself before exiting the method?
    public class TestingEngine {
    public void setStimuli(String[] values) {
       gui.setStimuli(values);
    public class GUI extends javax.swing.JFrame {
    public void setStimuli(String[] values){
           switch (testType){
             case SOUND:
                   String soundImageFile = "Headphones.jpg";
                   ImageIcon soundImage = new ImageIcon(soundImageFile);
                   JLabel soundImageLabel = new JLabel(soundImage);
                   SoundImageJPanel.removeAll();
                   SoundImageJPanel.repaint();
                   SoundImageJPanel.add(soundImageLabel);
                   soundImageLabel.setVisible(true);
                   label_S_Option1.setText(values[1]);
                   label_S_Option2.setText(values[2]);           // <-- nothing has updated yet
                   SoundClip clip = new SoundClip(values[0]);
                   if (clip.isInitialized())                     // <-- this section could also be replaced
                       clip.play();                             // by a time-wasting loop
                   break;
        }      // <-- once program reaches here, GUI finally updates
    }

    Ok, so just for the sake of it, I tried using the Timer method as suggested in the thread you pointed me to. This doesn't do anything, but thinking about it, I don't see why it would. Timer calls repaint() every 50 ms, but, after all, the setStimuli() method also called repaint() before playing the soundclip. If the original call of repaint() didn't do anything, then I don't think that calling it more often would.
    Is there another command that I should be using? In other words, how can I tell my JFrame and JLabels to "UPDATE RIGHT NOW, NOT IN A MINUTE!"? (It would be easier if I were the JFrame's mother...)
    Current version of code, with Timer class:
    public class GUI extends javax.swing.JFrame {
       private Thread refresh;
       public GUI() {
           initComponents();
           refresh = new Timer(this);
           refresh.start();
       public void setStimuli(String[] values){
           switch (testType){
             case SOUND:
                   String soundImageFile = "Headphones.jpg";
                   ImageIcon soundImage = new ImageIcon(soundImageFile);
                   JLabel soundImageLabel = new JLabel(soundImage);
                   SoundImageJPanel.removeAll();
                   SoundImageJPanel.repaint();
                   SoundImageJPanel.add(soundImageLabel);
                   soundImageLabel.setVisible(true);
                   label_S_Option1.setText(values[1]);
                   label_S_Option2.setText(values[2]);           // <-- nothing has updated yet
                   SoundClip clip = new SoundClip(values[0]);
                   if (clip.isInitialized())                     // <-- this section could also be replaced
                       clip.play();                              // by a time-wasting loop (same problem)
                   break;
       }      // <-- once program reaches here, GUI finally updates
       public void callback(){
           repaint();
    class Timer extends Thread
         private Gui parent;
         public Timer(Gui g) {
              parent = g;
         synchronized public void run() {
              while(true) {
                   try{
                       wait(50);
                   }catch(InterruptedException ie) {return;}
                   parent.callBack();
    }

  • Suspending GUI update

    I have an app which runs a background thread. While the thread is running I want to disable various clickable GUI elements. My problem is that the elements all disable rather slowly and it looks funny (they don't all disable simultaneously). Is there a way I can suspend GUI update, set all my elements to disabled, and then force the GUI to update them all at once?

    Well I'm actually doing this:
    @Action
    public Task runSimulation() {
        SimulationTask simulationTask = new SimulationTask();
        // some code to init my Task
        for (JPanel panel : playerPanels) { // playerPanels is a JPanel[10]
            panel.setEnabled(false);
        return simulationTask;
    }So the code to disable the panels runs before the task is even started. I tried adding the disabling code to the doInBackground method of my TaskListener attached to simulationTask but the delay is worse. The panels disable almost simultaneously using the above method but are out of sync just enough to make everything look amateurish and poorly done.
    As a side note this is written using the swing application framework in netbeans. The runSimulation method is attached to a button that runs a pretty CPU intensive task in the background.

  • Great Challenge !! No one is able to Tell Solution ? Dynamic GUI Updation

    Topic: Dynamic GUI Updation on msWindows when user changes Display properties.
    (I post this Question last month and have't got any answer, Is there no way for this ?)
    I want to dynamicly Update my UI on msWindows when user changes Display properties, Like other windows applications.
    i am doing this procedure-
    1.to get windows look & feel-
    UIManager.getSystemLookAndFeelClassName()
    2.To receive Events when when user changes Display properties-
    Toolkit.getDefaultToolkit().addPropertyChangeListener( "win.desktop.backgroundColor" ,new Java.beans.PropertyChangeListener()
    public void propertyChange(java.beans.PropertyChangeEvent e)
    3.To Reflect it in GUI-
    SwingUtilities.updateComponentTreeUI(TOP COMPONENT);
    But it only reflects the Border & Title Bar of My application.
    pls. suggest what can i do ?
    Regards
    Naveen Sharma

    I seem to remember looking at a similar thing in the Java demos that came with jdk1.3. I could be wrong...
    Let me see...
    Aha! Here it is.
    on my pc the path is
    C:\jdk1.3\demo\jfc\Metalworks
    then click on the jar file. The demo allows you to change the background color, font size on the toolbar etc..Another demo Swingset2 allows you to dynamically change the look and feel. I hope this helps. If you don`t have these demos I could always send you the code.
    Regards
    Grahame

  • Automatic song update stops randomly

    Hi,
    I'm running iTunes 6.0.4 (3) on OS X 10.4.6 with a 40 GB 3G Clickwheel iPod (firmware 3.1.1). It's worked fine for more than a year, but recently I restored the software and now automatic updates of music stop at random places (with no error messages, even after sitting for 24 hours or more!). Manual update (drag and drop, up to 8000 songs at once) works fine. I listen to a number of podcasts so would like automatic update to manage these for me.
    I saw several similar problems posted, including one I found on Google that no longer appears here. Does anyone have a solution for this?
    Thank you.
    ---Karl
    Mac Mini   Mac OS X (10.4.6)  

    Automatic update stops when I use USB 2.0 or FireWire -- no difference.

  • Apple TV 5.2 update stops in the middle of Step 1 of 2

    It look like Apple TV 5.2 updat stops in the middle of Step 1 of 2: Preparing update...  It's been sitting there for over an hour. Why and what can I do?

    Welcome to the Apple Community.
    You can't do much else besides pull the plug. If it causes further problems you should be able to restore as below:
    Get yourself a micro USB cable (sold separately), you can restore your Apple TV from iTunes:
        1.    Remove ALL cables from Apple TV. (if you don't you will not see Apple TV in the iTunes Source list)
        2.    Connect the micro USB cable to the Apple TV and to your computer.
        3.    Reconnect the power cable (only for Apple TV 3)
        4.    Open iTunes.
        5.    Select your Apple TV in the Devices list, and then click Restore.
    On the other hand you may be able to simply start the update again. If however the update continues to fail, you should try the restore routine above.

  • Why did update stop my data, why did update stop my data

    why did update stop my data, why did update stop my data on my iphone4 on straight talk plan and apple unlocked the phone ?
    Always worked before ?

    Try http://iphone.tweakker.com and select straight talk.

  • 30 new songs dissappeared when apple update stopped sync in progress!

    so i downloaded songs on my ipod and later plugged my ipod into my computer to download them to my itunes library.. as they were syncing to my library a stupid itunes update stopped the progress mid sync and i cant find my 30 new songs anywhere... is there anyway i can get those back?! or is this another apple dissappointment

    i resolved my problem.. when u go to ur itunes library they have a fancy purchased tab in the itunes store that has all the purchased songs you dowloaded.. so they let u re-download your selected songs to your intunes library, then all u have to do is sync ipod.

  • GUI Update and Threads

    Hello all, I'm new to Java and am having a hard time trying to understand how to implement multi-threading. I've built a simple app with GUI for converting files between encodings. The program works fine but some files take a long time to convert so I want to show the user some status text in the GUI. The conversion function is called from within a button click event, and further from within a loop that cycles through a directory of files to convert. I'm trying to show the name of the file being converted in a label in the GUI, but the label won't update until the button click event finishes, so only the last file converted is displayed.
    I've read through countless examples on this forum and others, and in several online books. I understand the concept of multi-threading and some of the issues surrounding them, but can't seem to grasp the mechanics of getting them set up in code at this point.
    Can anyone provide some coding tips? The code is provided below minus the NetBeans generated layout code. I can provide this also if needed. You'll see some lines commented out in the For loop that I tried but that didn't work.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class EnCon4 extends javax.swing.JFrame {
        //Declare variables and set default values
        String fname="UTF-16";
        String tname="UTF8";
        String infile;
        String outfile;
        /** Creates new form EnCon4 */
        public EnCon4() {
            initComponents();
        private void encodingToListActionPerformed(java.awt.event.ActionEvent evt) {                                              
            tname=(String)encodingToList.getSelectedItem();
        private void encodingFromListActionPerformed(java.awt.event.ActionEvent evt) {                                                
            fname=(String)encodingFromList.getSelectedItem();
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            jLabelStatus.setText("Converting From: " + fname + "  To: " + tname);
            jLabelStatus.repaint();
         File dir1 = new File ("."); //Set current directory
         //Create new subdirectory for converted files
         String newDirName = dir1 + File.separator + "Conv"; 
             File dir2 = new File(newDirName);
             if (!dir2.exists()) {
                dir2.mkdir();
             try {
                //Set path to current directory
                File pathName = new File(dir1.getCanonicalPath());
                File[] contents = pathName.listFiles();
                for (File file : contents) {
                    if (!file.isDirectory()) {
                        //Create the converted files
                    //Set variables
                    infile = dir1.getCanonicalPath() + File.separator + file.getName();
                    outfile = dir2.getCanonicalPath() + File.separator + file.getName();
                    //Check file names to exclude converting the java class file
                    if (!infile.endsWith("class") & !infile.endsWith("jar")) {
                            //Print the file name
                            jLabelStatus.setText("Converting file:  " + file.getName());
                            jLabelStatus.repaint();
                            //catch (Exception econ) {
                            //    System.out.print(econ.getMessage());
                            //    System.exit(1);
                            //System.out.println(file.getName());
                       //Call conversion function in a new thread.
                       //Example with static args //try { convert("NamesASCII.txt", "UTF8.txt", "ISO8859_1", "UTF8"); }
                           //Thread t = new Thread(new Runnable() {
                                //public void run() {
                                try {convert(infile, outfile, fname, tname);
                                catch (Exception econ) {
                                    jLabelStatus.setText(econ.getMessage());
                                    jLabelStatus.repaint();
                                    //System.out.print(econ.getMessage());
                                 //System.exit(1);
                            //t.start();
                //jLabelStatus.setText("Conversion complete.");
                //jLabelStatus.repaint();
             catch(IOException econ) {
                jLabelStatus.setText("Error: " + econ);
                //System.out.println("Error: " + econ);
        public static void convert(String infile, String outfile, String from, String to)
            throws IOException, UnsupportedEncodingException {
            // set up byte streams
            InputStream in;
            if (infile != null) in = new FileInputStream(infile);
            else in = System.in;
            OutputStream out;
            if (outfile != null) out = new FileOutputStream(outfile);
            else out = System.out;
            // Set up character stream
            Reader r = new BufferedReader(new InputStreamReader(in, from));
            Writer w = new BufferedWriter(new OutputStreamWriter(out, to));
            // Copy characters from input to output.  The InputStreamReader
            // converts from the input encoding to Unicode, and the OutputStreamWriter
            // converts from Unicode to the output encoding.  Characters that cannot be
            // represented in the output encoding are output as '?'
            char[] buffer = new char[4096];
            int len;
            while((len = r.read(buffer)) != -1)
              w.write(buffer, 0, len);
            r.close();
            w.flush();
            w.close();
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new EnCon4().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JComboBox encodingFromList;
        private javax.swing.JComboBox encodingToList;
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabelStatus;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration                  
    }

    There are two key principles here. The first is "remove long-running
    processes from the event dispatch thread". If in doubt, you
    can check with SwingUtilities.isEventDIspatch(). The second is
    "put GUI updates on the event dispatch thread", preferable
    with SwingUtilities.invokeLater().
    Today is my last day at work, so here's a fish:
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class EnCon extends JFrame{
        String fname="UTF-16";
        String tname="UTF8";
        String infile;
        String outfile;
        /** Creates new form EnCon4 */
        public EnCon() {
            super("EnCon");
            jButton1.addActionListener(new ActionListener() {
                public void actionPerformed(final ActionEvent ae) {
                    final Thread t = new Thread(new MyRunner());
                    t.start();
            final JPanel container = new JPanel();
            container.add(jButton1);
            container.add(jLabelStatus);
            this.getContentPane().add(container);
            this.pack();
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        private class MyRunner implements Runnable {
            public void run() {
                sendMessage("Converting From: " + fname + "  To: " + tname);
                File dir1 = new File ("."); //Set current directory
                //Create new subdirectory for converted files
                String newDirName = dir1 + File.separator + "Conv";
                File dir2 = new File(newDirName);
                if (!dir2.exists()) {
                    dir2.mkdir();
                try {
                    //Set path to current directory
                    File pathName = new File(dir1.getCanonicalPath());
                    File[] contents = pathName.listFiles();
                    for (File file : contents) {
                        if (!file.isDirectory()) {
                            infile = dir1.getCanonicalPath() + File.separator + file.getName();
                            outfile = dir2.getCanonicalPath() + File.separator + file.getName();
                            if (!infile.endsWith("class") & !infile.endsWith("jar")) {
                                sendMessage("Converting file:  " + file.getName());
                                try {
                                    convert(infile, outfile, fname, tname);
                                    sendMessage("Done");
                                catch (Exception econ) {
                                    sendMessage(econ.getMessage());
                catch(IOException econ) {
                    sendMessage("Error: " + econ);
            private void sendMessage(final String message) {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        jLabelStatus.setText(message);
        public static void convert(String infile, String outfile, String from, String to)
        throws IOException, UnsupportedEncodingException {
            // set up byte streams
            InputStream in;
            if (infile != null) in = new FileInputStream(infile);
            else in = System.in;
            OutputStream out;
            if (outfile != null) out = new FileOutputStream(outfile);
            else out = System.out;
            // Set up character stream
            Reader r = new BufferedReader(new InputStreamReader(in, from));
            Writer w = new BufferedWriter(new OutputStreamWriter(out, to));
            // Copy characters from input to output.  The InputStreamReader
            // converts from the input encoding to Unicode, and the OutputStreamWriter
            // converts from Unicode to the output encoding.  Characters that cannot be
            // represented in the output encoding are output as '?'
            char[] buffer = new char[4096];
            int len;
            while((len = r.read(buffer)) != -1)
                w.write(buffer, 0, len);
            r.close();
            w.flush();
            w.close();
        public static void main(String args[]) {
            new EnCon().setVisible(true);
        // Variables declaration - do not modify
        private JButton jButton1 = new JButton("Convert");
        private JLabel jLabelStatus = new JLabel("jLabelStatus");
        // End of variables declaration
    }

  • Windows update stopped running - no error code

    For some reason - presumably a virus, windows update stopped running. When I click windows update in control panel, screen freezes. Only way out is Ctrl+Alt+Del, access Task Manager - it reads Windows Update: Running, and kill the app. Help appreciated! 

    I have a problem, I got a message from the Lenovo solution center that "i never updated my windows" although I updated them and now I have windows 10. In order to fix this, they ask me to launch windows update but the thing is that I cannot launch it. I click on " launch" and nothing happens. I tried manually to find windows update and check for updates but there are no available updates any ideas?

  • Updated my iMac to mountain lion, had iCloud problems so I turned off iCloud. Then my software updates stopped coming through.  Turned iCloud back on but still not getting updates even when checking manually.  Help   Greg0954

    I updated my imac to osx mountain lion.  Had trouble with icloud affecting my itunes so I turned off iclouds.
    Then my automatic software updates stopped coming through.  Even when I check for them manually by
    clicking on software update it acts like it's checking for about one second then says "no updates available".
    It's been months since I've got any updates,  used to get them every week or two.
    Could turning off icloud have affected the necessary contacts ?  Please help, 
                                                         Greg0954

    I think all these problems are related, but might try this fo SWUPD...
    If you check for software updates using the App Store in OS X 10.8 and get "NSURLErrorDomain error -1100" the problem may be with your Software Update preferences. This is particularly likely if you were using a custom Apple Software Update server. To solve the problem, quit the App Store, move the following two files (if present) to the trash, restart, and only then rerun App Store updates:
    /Library/Preferences/com.apple.SoftwareUpdate.plist
    /Library/Preferences/com.apple.SoftwareUpdate.plist.lockfile
    http://x704.net/bbs/viewtopic.php?f=12&t=6130

Maybe you are looking for

  • Placing more than one images in one container (was: InDesign)

    Hi, I'm new to inDesign. Can anybody help me placing more than one images in one container like rectangle in which I can get coordinates of the different grphics/images with reference to the container not document page. Thanks and best regards Sal

  • Submitting forms getting forbidden error

    Hi all, We have a site which is having feedback option. after filling the feedback form and thee moment you press "send" it is giving forbidden error on browser. Please help me in resolving. Thanks in Advance. Mahesh

  • PSE 11 Organiser - Top of Organiser Disappeared

    I have lost the top of my PSE 11 organiser screen. I run a Mac with an external monitor. I can no longer see the resizing buttons (red, amber, green) top left, along with the folders, import option button, tag, info button etc. Its a nightmare. I hav

  • ICal and birthday calendar

    I have (among others) 3 entries in Address Book with birthday dates: 1978-04-22, 1981-08-21 and 1982-12-23. Non of them are shown in ical. But there is more. When i search for these people in ical search box i get following results: all these persons

  • Keyboard problems on ATT site

    Hey all, I've been trying to register my ATT acct through iphone. I get to the same point (asking for email address) and I can't type in the "@" sign. I can type letters and numbers, just no signs or punctuation. So if my email is "[email protected]"