Tab and turn off Java applet on web page

I have a Java applet with several custom elements embedded in a web page.

Is it possible to make elements in the applet part of the logical tab order of the rest of the page?

To clarify: I would like to use Tab to go from an element outside the applet to the first element of the applet, and then use Shift + Tab to return to the element outside the applet. Similarly, I would like to use Tab to go from the last element of the applet to the next element of the web page and to go back use Shift + Tab .

+6
java applet focus tab-ordering
source share
1 answer

You can define the tab order on your page by adding tabindex attributes to your elements, including your object applet. You can define the tab order in your applet by extending the FocusTraversalPolicy class .

Suppose you have three page controls - A , B, and C , the second of which - B - is your applet and the three applet controls are X , Y, and Z. If you create controls A , B and C tabindex 1 , 2 and 3 and X , Y and Z from first to third in a loop, your effective tab order will be: A , X , Y , Z , C.

+4
source share

All Articles