简体   繁体   中英

Tabbing in and out of Java applet on web page

I have a Java applet with several focusable elements that is embedded in a web page.

Is it possible to make the 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 move from an element outside the applet to the first element of the applet and then use Shift + Tab to move back to the element outside the applet. Similarly I would like to use Tab to move from the last element of the applet to the next element of the web-page and use Shift + Tab to move back.

You can define the tab order within your page by attaching tabindex attributes to your elements, including your applet's object element. You can define the tab order within your applet by extending the FocusTraversalPolicy class .

Let's say you have three page controls — A , B , and C — the second of which — B — is your applet, and three applet controls — X , Y , and Z . If you make controls A , B , and C tabindex 1 , 2 , and 3 and X , Y , and Z first through third in the traversal cycle, your effective tab order will be: A , X , Y , Z , C .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM