Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JFileChooser's focus

Status
Not open for further replies.

tictaclam

Programmer
Jan 8, 2004
47
US
Hi
I am using a JFileChooser with multiple selection enabled. It does work I just have a question about focus. When I selected two items that are far enough apart in the directory that I have to scroll, selecting the second file always causes the focus to jump back to the first file. It does keep both files selected, but I was wondering if there is a way to prevent the focus from jumping. thanks!
tictaclam
 
You should single click first file, press the control key and hold it, click second file.
 
The problem is not selecting two files. That can be done. It's that if the two files are far enough apart they it requires scrolling within the browse window, selecting the second file causes the focus to jump back to the first file.
 
After you have started holding the control key, you can select another file, or scroll the browser window and select another file.
 
I think you are misunderstanding my question. I know how to select two files. I did hold down the control key and scroll the browser window and select another file. However, once i select the second file (both files are indeed selected) the focus jumps to the first file. This jumping of focus happens everytime and it's irritating to use but both files are still selected. Is there any way i can prevent the window from changing focus. Everything works it's just not very user friendly.
 
It's a bit strange, I don't have that behaviour with my fileChoosers. Once I select the second file, it remains focused.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top