如何使 Java 选项卡式窗格从右到左显示选项卡?
在 C# 中,为了使选项卡从右向左移动,我将 RightToLeft 设置为 Yes,将 RightToLeftFormat 设置为 true。我如何在 Java 中做同样的事情?如何设置 JTabbedPane 的选项卡从右到左显示?请参阅下面的图片链接,了解从右到左显示选项卡的含义。
http://lh4.ggpht.com/_1bcR6vegNNc/TPDRekNVqWI/AAAAAAAAAB8 /TwCqgajEuoI/s640/AdminDashboard.jpg
In C#, to make the tabs go from right to left, I set RightToLeft to Yes and RightToLeftFormat to true. How do I do the same thing in Java? How do I set a JTabbedPane's tabs to display from right to left? Please see the image link below to see what I mean by displaying tabs right to left.
http://lh4.ggpht.com/_1bcR6vegNNc/TPDRekNVqWI/AAAAAAAAAB8/TwCqgajEuoI/s640/AdminDashboard.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您所说的“选项卡式窗格”指的是 javax.swing.JTabbedPane。
回答你的问题:AFAIK没有简单的方法可以做你想做的事。负责绘制选项卡式窗格的选项卡区域的 BasicTabbedPaneUI(或由应用程序外观定义的 TabbedPaneUI)需要进行一些更改才能执行您需要的操作。
如果您没有时间编写自己的 UI,您可以在网络上寻找解决方案。我怀疑是否有现成的解决方案可以解决您的问题,但话又说回来,谁知道呢?
希望这对您有一点帮助。
I assume by "tabbed pane" you are referring to javax.swing.JTabbedPane.
To answer your question: AFAIK there is no easy way to do what you want. The BasicTabbedPaneUI(or the TabbedPaneUI which is defined by your application look and feel) which is responsible for painting the tab area of the tabbed pane would require some changes to be able to do what you need.
If you do not have the time to write your own UI, you could look for solutions in the web. I doubt that there would be a ready to use solution to your question though, but then again, who knows?
Hope this helps you a bit.
然后我参考“如何使用选项卡式窗格”来创建一个基于 JTabbedPane 组件的新项目...
使用“setComponentOrientation”方法来更改 JTabbedPane 的方向就足够了。
链接文本
Then i'm refer from "How to Use Tabbed Panes" to create a new project based by JTabbedPane component...
It's enough to use "setComponentOrientation" method to change orentation of JTabbedPane.
link text