java amateur
Rob Camick wrote:Sounds like Tabbed Pane Focus will solve your problem.
java amateur
java amateur
Rob Camick wrote:That is not a SSCCE.
java amateur
java amateur
Rob Camick wrote:Well, the first step is a simple demo with no custom code, just a couple of tabs with a couple of test fields to see if focus works properly.
I claim it works properly as demonstrated by the demo below. When the program starts up focus is on the first tab. Then you can use the Tab key or click on the text field. Now when you click on a tab, the focus will always be on the first text field, proving that the default behavour works.
(...)
Then for some reason you think you need to write a custom FocusTraversalPolicy. So try adding that code. If it doesn't work then you know the problem is with your custom code. Start simple, make one change at a time until it stops working.
java amateur
java amateur
What does the button have to do with anything? In the original code I gave you focus is on the "tab", not the text field on the tab, so I don't understand why you added the button.
Now when you click on a tab, the focus will always be on the first text field, proving that the default behavour works.
java amateur
one conclusion i can draw is that default behaviour vanishes the moment more components are added (my case)
java amateur
what means EDT?
i mean the 2nd refers to the TAB and the 3rd to the components inside my panel, correct?
java amateur
java amateur
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|