I'm writing a program in Java GUI. I have a main JFrame
from which released with SQL queries buttons and also a JFrame
with gif
.
For SQL queries, I've created a class that provides connection to the database and has a method for each type of query.
The fact is that while doing the query, the new JFrame
with gif
freezes.
I know that is because the query is not a Thread
. But inherit from Thread
is not the solution at all.
I want every method of consultation is like a Thread
. To also be able to launch it from anywhere in the main JFrame JFrame without any freezing.
Thank you very much.