Swing requestFocus blues part II


hmm - i probably didn't explain my problem very well the last time - or at least not to the point.
But I got one answer though.

"Just catch component shown event and then request focus " - Krage Termini

Well, this is ok and solves the problem of "when this panel is first shown which component should get the focus"-problem.

The other problem of just being able to say somepanel.requestFocus() instead of somepanel.getAField().requestFocus() (which breaks encapsulation) is not solved by this one.

Maybe one should just override .requestFocus() on the "somepanel" which delegates the call to the "first field" ? hmm - is that the correct way ? It sounds "messy" to be forced to inherit from JPanel to encapsulate it's focus mechanism....