Multiple JFrame focus

B

Bojan

Hi,

I created a Java application that has a Progress window while it is
loading. Using multithreading I have managed to create one and it
works fine. What i want is for the main window to focus on the
progress window all the time. In other words I do not want you to be
able to see the main window by-itself whent he progress window is
open. I am using JFrame for both of the windows.

How can I do this?

Thanks in advance
 
K

Knute Johnson

Bojan said:
Hi,

I created a Java application that has a Progress window while it is
loading. Using multithreading I have managed to create one and it
works fine. What i want is for the main window to focus on the
progress window all the time. In other words I do not want you to be
able to see the main window by-itself whent he progress window is
open. I am using JFrame for both of the windows.

How can I do this?

Thanks in advance

setVisible(false)
 
B

Bojan

setVisible(false)

I dont think you understood what i want. I want the Progress Bar to
be always on top. I have read that I could create an event listener,
and when it is toBottom(), make progress bar jump back on top using
toFront(); I have not tried this yet, since i am worried about other
windows that are not part of the application.

Is there any simpler way?
 
K

Knute Johnson

Bojan said:
I dont think you understood what i want. I want the Progress Bar to
be always on top. I have read that I could create an event listener,
and when it is toBottom(), make progress bar jump back on top using
toFront(); I have not tried this yet, since i am worried about other
windows that are not part of the application.

Is there any simpler way?

Use a modal dialog.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top