Imagine a login dialog. You got a label saying "Username" and a text field where the user should input the username.
You would typically use the JLabel#setDisplayedMnemonic to define say 'U'. Then you would use JLabel#setLabelFor(userNameField).
After this, when the user hits Alt+U, the user name text field would gain the focus.