Forums Register Login

Show wait box while executing database query

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1260 times.
Similar Threads
internet info in application
Servlet/JSP problems
Instantiated components from within a thread aren’t repainting into a JFrame in Java
Progress Bar in JSP
What's the difference between JQuery and SimpleORM?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:56:37.