• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UI flickrs continously jdk1.7 EventdispatchThread's pumpEventsForFilter goes to infinite while loop

 
Greenhorn
Posts: 9
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am migrating a project from Java 1.3 to Java 1.7 update 25 and there is one search button functionality in which search is performed correctly but the UI flickers continuously because EventdispatchThread's pumpEventsForFilter goes to infinite while loop.

This same code works correctly in java 1.3.

Below is the part of the code related to searchbutton. Can you please suggest regarding this because the issue is within java api and not sure how to solve this.


SearchButton.java:

-----
EventDispatchThread:
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In future while posting code, please UseCodeTags. I have added them this time for you. As you can see they make the code much more easier to read and understand.

The (unformatted) code you posted doesnt help us identify the problem. Please post your SSCCE (and formatted) code
 
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What he said. Also , if it helps motivate you to create a SCCEE- which is sometimes a bit of a labor since the troublesome code is not likely to have come from an SCCEE- consider that by doing so you potentially benefit by accidentally solving your own problem. For instance, in this exact case, you've made an assumption about where the problem lies- it's somewhere in the code you posted. But what if that assumption is false? What if the problem isn't there? What if it's something about how the code you posted interacts with code you didn't post? You'd actually discover that by creating an SCCEE and have it work as expected.

As it is, because too much of the scope of the entities you posted is just missing, it's impossible for this reader to troubleshoot your problem. If you can come back with an SCEEE, then people will gladly loook it over.

HTH!
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
while it is not impossible the problem is with the API it is extremely unlikely. one thing i notice is before the loop you set doDispatch = true, but inside your loop you never set it to false. so the only way the loop can end is if isInterrupted() becomes true or cond.evaluate() becomes false
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic