JButton Focus
I have a window with JTable at the bottom and split pane at the top. When the user is interacting with the application and fills out a form in a pop-up window, the application displays images and its corresponding data in the JTable.
I want the focus to be on the JButton that is next to the toolbar after the images and its data are displayed on the window.
I tried myButton.requestFocusInWindow() call, it doesn't do anything. Any ideas on how I can make the jbutton gain focus? TIA.
The button is visible and is enabled. I tried your code snippet. No luck. When I hit enter, the button does not have the focus, so I am not able to push the button (using keyboard only, no mouse is involved here.).
When I tab the JTable gets the focus. How can I make the button gain the focus at least when I tab once? Thanks for the tip.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.