是否可以仅使某些选项卡可聚焦(JTabbedPane)?

发布于 2024-11-12 07:58:23 字数 90 浏览 4 评论 0原文

是否可以仅使某些选项卡可聚焦,例如 5 个选项卡中的前 3 个?这样,当使用左右键更改选项卡时,将跳过不可聚焦的选项卡(仅通过鼠标单击显示)。

谢谢!

It is possible to make just some tabs focusable, for instance the first 3 of 5 tabs? So that when changing tabs with the left - right keys, the non-focusable ones to be skipped (to be displayed only by mouse clicks).

Thanks!

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

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

发布评论

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

评论(1

满天都是小星星 2024-11-19 07:58:23

所有 Swing 组件都使用 Actions 来处理按键事件。因此,您可以将现有操作替换为您自己的自定义操作。

查看按键绑定以查看为选项卡定义的操作窗格。

您还可以找到换行操作表格选项卡很有帮助,因为它们展示了如何在自定义时重用现有操作 行为。

All Swing components use Actions to handle key events. So you can replace the existing action with a custom Action of your own.

Check out Key Bindings to see the Actions that are defined for a tabbed pane.

You may also find Wrapping Actions and Table Tabbing helpful as they show how you can reuse existing Actions when customizing behaviour.

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