Is it possible to keep the tab sequence looping in one container instead of going to each item in 1 container and then going to the other container?
No, this is currently not possible.
It depends on what controls the container holds. Almost all the input type controls will eventually receive the focus if you keep pressing the tab key. The exceptions to this are the buttons. If you set their Focusable property (an expert property) to false, you can still click on them with the mouse but you cannot reach them by pressing the tab key.
Hopefully this will help you achieve what you want.
Then how about programming where the focus goes after you click a button?
When you click on a button that can take the focus, the focus will normally stay on the button. When you click on a button that can’t take the focus (because its Focusable property is set to false) the focus will not move from its current location.
If you want to, you can force the focus to another control using the .requestFocusInWindow() method e.g.
button = event.source.parent.getComponent("Button")
button.requestFocusInWindow()I can’t think I’ve ever seen a great reason for doing this. Do you want to give more details of what you’re trying to achieve?
I’m using PMI to collect inspection data on line and I’m trying to keep the steps as simple as possible for the operator, I’m hoping to put the data entry part of the screen in a continual loop so the operator only has to use a number keypad.