This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Field loses focus? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Field loses focus?" Watch "Field loses focus?" New topic
Author

Field loses focus?

Alan Smith
Ranch Hand

Joined: Oct 19, 2011
Posts: 152

Hi,

what does it mean when talking about input fields, that the field can lose focus? I have seen that a few times but I am reading a java book now and it mentions it but never explains it.

Thanks,
Alan
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

In a GUI, normally one of the GUI elements (text boxes, buttons, etc.) has the focus, which means that if you type, the text appears in the text box that has the focus, or when you press space, the button that has the focus is clicked.

When the focus goes from one GUI element to another, for example because you press the Tab key, then the element that previously had the focus loses it, and it goes to the next GUI element.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Alan Smith
Ranch Hand

Joined: Oct 19, 2011
Posts: 152

Ok, thanks. So basically the "active" element i.e. the button that has that square border thing in it when you are tabbing between buttons or the text field that has the blinking cursor.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Field loses focus?