如何将 JTabbedPane 标题中的布局复制到 JPanel 上?
我创建了一个 JTabbedPane 的“CollapsingPanel”类/排序(代码框架可以在 http://www.coderanch.com/t/341737/Swing-AWT-SWT-JFace/java/Expand-Collapse-Panels)。换句话说,它是许多标题,您单击它们即可显示隐藏的面板。目前,这些标题面板是一个矩形框,周围有 LineBorder。那太丑了!
我想知道是否有一种方法可以复制 JTabbedPane 用于其标题/标题的布局(我认为这是从 Look&Feel 继承的)并将其用于基于 JPanel 的标题?这样我的标题就会有一个平滑的外观,与程序的其余部分一致(基于外观和感觉!),而不是看起来像外星人的扁平块。
如下图所示,标题用绿色圈出。我想将第二张图片的标题外观应用到图片 1 中的红色标题 JPanel 上:
I have created a "CollapsingPanel"class/sort of a JTabbedPane (code skeleton can be found at http://www.coderanch.com/t/341737/Swing-AWT-SWT-JFace/java/Expand-Collapse-Panels). It is in other words a lot of headers which you click on to show a hidden Panel. At the moment these header-panels are a rectangular box with a LineBorder around them. That is ugly!
I'm wondering if there is a way to copy the layout that the JTabbedPane uses for its headers/titles (which is inhierted from Look&Feel I assume) and use it on my JPanel-based headers? So that my headers get a smooth look which is in line with the rest of the program (based on Look&Feel!) instead of looking like alien flat blocks.
Illustrated below with the headers nicely circled in green. I want to apply the header-look from 2nd picture over the red header JPanel in picture 1:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论