是否可以将垂直选项卡设置为透明背景
我有一个选项卡式窗格设置并设置在左侧,以便选项卡从上到下。不幸的是,未使用的空间是丑陋的灰色。我无法将其设置为完全透明。这与父框架的 setUndercorated(true) 相结合,它应该具有悬挂在窗口上方的效果。我如何将其设置为透明?
I have a tabbed pane setup and set to the left so that the tabs go from top to bottom. unfortunately, the unused space is an ugly gray color. im having trouble setting that to be completely transparent. This combined with the setUndercorated(true) for the parent frame, it should have the effect of hanging over the window. how do i set it to transparent?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为没有一种简单的方法可以满足您的要求。您可能需要覆盖 JTabbedPane 绘制自身的方式。另外,请注意 JFrame.setUndecorated(true) 与 JTabbedPane 无关。它只是意味着 JFrame 不包含窗口框架(标题栏和最小化/恢复/最大化图标)。
I don't think there is a simple way to do what you are asking. You'll probably need to override the way JTabbedPane paints itself. Also, please note that JFrame.setUndecorated(true) has nothing to do with the JTabbedPane. It just means that the JFrame does not contain the window frame (the title bar, and minimize/restore/maximize icons).
默认情况下该区域是不透明的。如果您想要不同的颜色,请设置添加选项卡式窗格的面板的背景。
如果您有问题,请发布您的 SSCCE 以显示问题。
That area is non-opaque by default. Set the background of the panel you add the tabbed pane to if you want a different color.
If you have problems then post your SSCCE showing the problem.