• Post Reply Bookmark Topic Watch Topic
  • New Topic

Show wait box while executing database query  RSS feed

 
dave sturgeon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!