aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "FocusListener Watch "FocusListener New topic
Author

FocusListener's isTemporary()

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi,
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.
thanks!
maulin.
Michael Ernest
High Plains Drifter
Sheriff

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: http://aspose.com/file-tools
 
subject: FocusListener's isTemporary()
 
Similar Threads
VK_BACK_SPACE
LostFocus and SwingUtilities.invokeLater()
Focus Lost - Getting called twice.
Focus issues among JTextField and Dialogs
How can I keep focus on the component pressed until I pressed other component????