Call transferFocus or requestFocus?

in my application, I get a component for focusing, it can be jpanel, and it can be jbutton or a custom user component

how can I find out when to transfer transferFosus, and when to call requestFocus

Thanks you

+3
source share
3 answers

transferFocus()sends focus to the next component. Also note that transferFocus()it will always transmit focus in the forward direction.

requestFocus()sends focus to the calling component. However, there is no guarantee that this will be successful. Focused behavior is platform dependent to a certain extent.

- requestFocusInWindow(). . - .

+3

transferFocus(), . requestFocus() .

Swing

+1

, , , / . transferFocus , requestFocus .

0

Source: https://habr.com/ru/post/1742728/


All Articles