requestDefaultFocus
public boolean requestDefaultFocus()
Requests the focus for the component that should have the focus by default. The default implementation will recursively request the focus on the first component that is focus-traversable.
Returns:
false if the focus has not been set, otherwise return true
这只是告诉你 一个组件是否有 focus
=======================================================
requestFocus
public void requestFocus()
Sets focus on the receiving component if isRequestFocusEnabled returns true and the component doesn't already have focus.
这才是设置 focus明白了吧
public boolean requestDefaultFocus()
Requests the focus for the component that should have the focus by default. The default implementation will recursively request the focus on the first component that is focus-traversable.
Returns:
false if the focus has not been set, otherwise return true
这只是告诉你 一个组件是否有 focus
=======================================================
requestFocus
public void requestFocus()
Sets focus on the receiving component if isRequestFocusEnabled returns true and the component doesn't already have focus.
这才是设置 focus明白了吧
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货