Mouse « Focus « Java Swing Q&A





1. Changing focus w/o using mouse    coderanch.com

Hi Leslie, You need a reference to each frame to do anything. If you have a reference to the other frame you could try and request focus. I am not really sure about the API. I would start looking in the Component API. I am not sure how to do it if you don't have a reference to the other frame. ...

2. Get Focus Using Mouse    coderanch.com

I want to be able for the keyboard to focus on one component at startup and then switch back and forth only when the mouse is clicked on a component. I explored this in/with the app below it seems to work according to what you want with the exception that the tab key also shifts the focus back and forth. Maybe ...