It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes FocusListener's isTemporary() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "FocusListener Watch "FocusListener New topic

FocusListener's isTemporary()

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
there is a confusion in my mind about isTemporary() method,
say, we have a button in a frame and it's selected. so when we minimize that frame we get temporary focus lost on that button and isTemporary() is true in that case (becuase actually focus is not lost and when we maximize the frame again we still have focus on that button)
but, when we will have temporary focus gained??? meaning when we can have isTemporary() true in focusGained() method???
if someone can give me an example it would be great. i tried to think of the example but i'm not able to come up with any example.
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

isTemporary() belongs to FocusEvent, not FocusListener.
Temporary loss of focus includes other operations that are perceived as "quick grabs" from the current component. For example, when the user manipulates the scrollbar's slider, the button shouldn't be simultaneously clickable. Focus changes accordingly, but only for as long as the scrolling operation continues.
When scrolling is complete, all FocusListeners are notified that attention is now back on the original button.
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
I agree. Here's the link:
subject: FocusListener's isTemporary()
It's not a secret anymore!