How to set tab order in swing Java?
•
Java
I want to know how to adjust the Tab order in the Swing interface. I found an example that shows the trick this method should do, but it seems that it has been deprecated rather than working
getCom@R_943_2419@("cmbFrom").setNextFocusableComponent(getCom@R_943_2419@("cmbTo"));
Note: – the following method returns a with a parameter name Com@R_943_2419 @Object It would be great if someone knew how to use the NetBeans ide I found a method in eclipse WindowBuilder, but not in the NetBeans ide thank you.
getCom@R_943_2419@(String s)
Solution
You can use setfocustraversalpolicy. In the container
The focustraversalpolicy class is abstract. You need to implement several methods that will return the focus order of the components of the container It will be used with tab and shift tab
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码