是否可以仅使某些选项卡可聚焦(JTabbedPane)?
是否可以仅使某些选项卡可聚焦,例如 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所有 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.