JTabbedPane:选项卡本身之前和之后的组件
这类似于问题 如何在 Java Swing 中构建 Google-chrome 选项卡和菜单栏界面?(我想完成同样的任务),但更重要的是:如何将组件放在 JTabbedPane 中选项卡的前面和后面?
我自己已经提出了按钮的想法,但我宁愿有一个 JTabbedPane,因为它确实如此,但侧面装饰有按钮或图标。
我已经看到 Kirill 的 laf-widget 项目做了类似的事情(放大- 选项卡左侧的玻璃图标)用于多个 LaF。 然而,我必须承认,我还不够熟练,无法理解他是如何做到这一点的 - 而且这似乎是一个有点复杂的过程,其中一个人“物理地”改变有问题的 LaF(字节码操纵它),注入 laf - 将小部件内容放入 UI 委托中 - 我仍然不知道 JTabbedPane 或 TabbedPaneUI 实际上是如何调制以注入该图标/按钮的。
This is similar to the question How to build a Google-chrome tabs and menubar interface in Java Swing? (I want to accomplish the same), but more to the point: How do I put components in front and behind the tabs in a JTabbedPane?
I've already come up with the buttons-idea myself, but I'd rather have a JTabbedPane, since that is really what it is, but decorated with a button or icons on the sides.
I've seen that the laf-widget project from Kirill does something like it (the magnifying-glass icon to the left of the tabs) for several LaFs. However, I must admit that I'm not yet well enough versed to understand how he does it - and also it seems like a somewhat complicated process, whereby one "physically" change the LaF in question (bytecode manipulates it), injecting the laf-widget stuff into the UI delegates - and I still don't know how the JTabbedPane or TabbedPaneUI is actually modulated to inject that icon/button.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最后向 Substance LaF/laf-widget 的基里尔询问了他如何设法将装饰 JTabbedPanes 的 laf-widget 选项卡前面的按钮,这是他的回复:
谢谢,基里尔!
I finally asked Kirill of Substance LaF/laf-widget of how he manages to put a button in front of the tabs in the laf-widget that decorates JTabbedPanes, and this is his reply:
Thanks, Kirill!
JIDE 有一个选项卡式窗格作为其组件套件的一部分,将该功能公开为简单的 setBeforeComponent() 和 setAfterComponent( ) 方法。
这里有一个演示: http://www.jidesoft.com/products/ 1.4/jide_demo.jnlp
JIDE have a tabbed pane as part of their component suite that exposes this functionality as simple setBeforeComponent() and setAfterComponent() methods.
There's a demo of it in here: http://www.jidesoft.com/products/1.4/jide_demo.jnlp