• 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

Show wait box while executing database query

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to be able to show some sort of messagebox that says something like 'Querying database' while a query is being executed in my program.
Currently, I create and show a JFrame which displays my message and then straight after this I execute my query. Because the execution of the query seems to hog the cpu the JFrame that I just tried to show is not painted correctly - It just paints the outline of the frame. Once the query completes I then unload the JFrame.
I want to make sure that when the JFrame is displayed just before the query, it is fully painted and the user sees a 'Querying Database' message. Any help would be greatly appreciated.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have ran into the same problem before, and I am not real sure if there is a fix for it. I first tried to put the query in a thread, but it still ate so much CPU time that it still didn't paint my wait window. So then I tried using a wait command of some sort or a for loop just as a counter so that it would draw the JFrame and then go to the other process but that didn't seem to work either. Someone else on here I read a while back said it was a JAVA problem. I hope that someone has a fix for it though. I know this doesn't solve your problem, but I just wanted to add my two cents.
Happy Coding
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic