These API is used to implement an example application. This has two GUI windows, an Observable data class and a starter program.
Also using '-client' parameter to the java executable made no difference. Ofcouse this program has no real value except to demonstrate the problem, but other programs are not responsive either (for example, when selecting a rectangle in a window, the rectangle does not follow the mouse immediately, which is very annoying). Last worked in version 7u51 ADDITIONAL REGRESSION INFORMATION: java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java Hot Spot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : I made a small test program to reproduce this. The result is a continuously moving black block from left to right (100 ms between each color change).
Save the attached source as Slow Gui and compile the source. Swing Utilities; public class Slow Gui Update } public static void set Color(final JButton buttons, final int i, final Color c) } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : As far as I know, there is no workaround. At this point, I can't use Java 8 for GUI stuff, so there is no point in converting my sources to Java 8.
It is as if the GUI thread falls asleep after a second, and will only refresh the window each half a second or something like that, instead of continuously.
I checked this with JDK 8 64 bit and JDK 32 bit and there was no difference. First button 1 becomes black, then button 1 reverts to red and button 2 becomes black, then button 2 reverts to red and button 3 becomes black, etcetera.
It basically tells the GUI, "I'd like to be redrawn, but only when it's convenient for you." So the square won't repaint until something happens in the native GUI that's important enough to actually do the redrawing, which in your case is the window being resized.
It requests an erase and redraw after a time delay, and that time dealy is determined by the native GUI.I might well be remembering the names wrong though..This chapter describes how to add Java FX content into a Swing application and how to use threads correctly when both Swing and Java FX content operate within a single application. This class starts the application; displays the two GUI windows. The example code Example App is listed at the end of this post. I'm having a problem refreshing a JFrame when clearing the content Pane and then adding a new JPanel to it.For more information related to setting the JFrame size, see the Javadoc for the Java Window class (which JFrame inherits from).