在网页上按 Tab 键进出 Java 小程序

发布于 2024-09-12 06:40:20 字数 271 浏览 2 评论 0原文

我有一个嵌入在网页中的带有多个可聚焦元素的 Java 小程序。

是否可以使小程序中的元素成为页面其余部分的逻辑选项卡顺序的一部分?

澄清一下:我想使用 Tab 从小程序外部的元素移动到小程序的第一个元素,然后使用 Shift+Tab 移回小程序外部的元素。同样,我想使用 Tab 从小程序的最后一个元素移动到网页的下一个元素,并使用 Shift+Tab 向后移动。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亢潮 2024-09-19 06:40:20

您可以通过将 tabindex 属性附加到您的元素(包括小程序的 object 元素)来定义页面内的 Tab 键顺序。您可以通过扩展 来定义小程序中的 Tab 键顺序FocusTraversalPolicy

假设您有三个页面控件 - ABC - 其中第二个 - B -是您的小程序,以及三个小程序控件 - XYZ。如果您将控件设为 ABC tabindex 123 以及 XYZ 遍历中的第一到第三个循环,您的有效 Tab 键顺序将为:AXYZC< /强>。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文