Re: Focus



Frances wrote:
I see two methods for setting focus:


-- requestFocus() Requests that this Component gets the input focus.

-- grabFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.


(which one is it, then, 'this Component' or 'top-level ancestor'? -- which one gets focus? ('ancestor' meaning what exactly? what if if you have just one component (and thus no 'ancestor'...))


neither one of these two methods is working for me.. let's say I have a JTextArea called TA... neither TA.grabFocus() or TA.requestFocus() is working..


why no simple Focus() method? (focus this component... seems too simple, I know...) thank you very much... Frances

sorry, neglected to mention, this is not in reponse to user-event, but for when window opens, it's for an IM window, so top textArea should NEVER have focus and bottom textArea should ALWAYS have focus.. thanks again...
.




Relevant Pages

  • Re: Focus
    ... > Requests that this Component gets the input focus. ... > Component's top-level ancestor become the focused Window. ... Notice that if you have a textbox in a window, ...
    (comp.lang.java.gui)
  • Re: AJAX question..
    ... Frances said: ... remembering that you are the same user across a series of otherwise ... unrelated page requests. ... Http is a stateless protocol which doesn't ...
    (comp.lang.javascript)
  • Focus
    ... Requests that this Component gets the input focus. ... ('ancestor' meaning what exactly? ...
    (comp.lang.java.gui)
  • Re: Focus
    ... > Requests that this Component gets the input focus. ... >Component's top-level ancestor become the focused Window. ... the window is the focused WINDOW. ...
    (comp.lang.java.gui)