如何在 JTabbedPane 中制作双线
我不确定我的标题有多大意义,但既然你应该有一个不错的标题,这是我想出的最好的标题,所以我实际上的意思是......
让我们说理论上我有10 个选项卡,我不想将它们全部压缩在 1 行中,而是将它们分成 2 个,因此我在上侧有 5 个选项卡,在下侧有 5 个选项卡。 示例图片:
I'm not sure how much of sense my title does but since you are suppose to have somewhat of a good title this was the best I came up with, so what I actually mean is...
Let's say in theory I've got 10 tabs, and instead of having them all compressed together in 1 line I'd like to split them in 2, so I'd have 5 tabs on the upper side and 5 on the lower.
Example pic:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不清楚你的问题,但 JTabbedPane 中有选项卡的基本方法
not clear your question, but there are basic methods for Tabs in the JTabbedPane
如果您希望它们全部显示在一行中(我认为这就是您描述的后半部分所指示的......),您需要将选项卡布局策略设置为 JTabbedPane.SCROLL_TAB_LAYOUT 。
这是一个带有图像的示例。
If you want them all displayed in a single row (which I think is what the latter part of your description indicates...), you'll want to set the tab layout policy to
JTabbedPane.SCROLL_TAB_LAYOUT
.Here's an example with an image.