- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这类似于问题How to build a Google-chrome tabs and menubar interface in Java Swing? (我想完成同样的任务),但更重要的是:如何将组件放在 JTabbedPane 中选项卡的前面和后面?
我自己已经提出了按钮的想法,但我宁愿有一个 JTabbedPane,因为它确实如此,但侧面装饰有按钮或图标。
我已经看到 laf-widget Kirill 的项目为几个 LaF 做了类似的事情(选项卡左侧的放大镜图标)。然而,我必须承认,我还不够熟练,无法理解他是如何做到这一点的——而且这似乎是一个有点复杂的过程,其中一个人“物理地”改变有问题的 LaF(字节码操纵它),注入(inject) laf -将小部件内容放入 UI 委托(delegate)中 - 我仍然不知道 JTabbedPane 或 TabbedPaneUI 实际上是如何调制以注入(inject)该图标/按钮的。
最佳答案
我终于问了 Substance LaF 的基里尔/laf-widget 他如何设法在 laf-widget 的选项卡前面放置一个按钮来装饰 JTabbedPanes,这是他的回复:
It relies on the BasicTabbedPaneUI.tabAreaInsets field to make room for the button, and custom setBounds of the button component to position itself in that area.
For more code, see TabOverviewButton and TabOverviewDialogWidget classes in the laf-widget project.
In general, the tabbed pane UI delegate is one of the least attractive ones to enhance since it has a lot of private and package protected methods
谢谢,基里尔!
关于java - JTabbedPane:选项卡本身之前和之后的组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/888856/
我编写了一个小程序,用于创建带有选项卡式 Pane 的简单 GUI。目前它有两个选项卡。在一个选项卡中我创建了一个按钮,在另一个选项卡中我创建了两个按钮(基于第三类中的字符串)。我无法做的是在第二个选
我想在单击负责使用 Action Listener 计算的按钮后将选定的 JTabbedPane“计算”更改为 TabbedPane“结果”。 最佳答案 class ButtonHandler imp
收到此错误: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Project.reportpane.a
我遇到的问题是,在 JTabbedPane 内部时,内部面板的背景颜色未设置(或未显示) 我有以下结构: JPanel BorderLayout: JTabbedPane (BorderLayo
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 9 年前。 Improve t
在我的 JTabbedPane 中,我以两种不同的方式删除标签: tabbedPane.remove(index) 和 tabbedPane.removeAll() 两者在关闭选项卡方面都可以正常工作
我有一个使用 JTabbedPane 来显示多个不同选项卡的应用程序。这些选项卡之一有一个正在运行的线程来显示其内容。我已经实现了一个 ComponentListener 来在选项卡不可见时停止线程。
我想让我的选项卡标签共享 JTabbedPane 宽度。如果有一个标签,适合整个宽度,如果两个标签共享宽度,如果三个,每个 1/3,依此类推... 我什至不知道是否可以在不将组件放在那里并调整其大小的
我想知道如何从左侧开始设置 JTabbedPane 的选项卡位置。默认情况下,它们处于中间位置,因为我使用的是 Mac OS X。 如果您需要更多信息,请告诉我。 查看此图像以了解我使用默认 JTab
在这个 JTabbedPane 截图中 我正在使用 Netbeans 的 DnD,我一直在修改它只是为了在选项卡之间放置空格。到现在我还是得不到我想要的。 有办法吗? 最佳答案 我不确定其他方法,但我
我对java相当陌生,正在创建一个windowbuilder程序。我想知道在使用 Jtabbedpane 并在程序窗口中的选项卡之间切换时是否可以使用 Action 监听器从单独的类获取内容。例如,我
给定一个 contentPane 布局设置为 null 的 JFrame,我想添加两个选项卡,一个用于发布者,另一个用于订阅者,例如: public class PubSubGUI extends J
在 JTabbedPane 中,选项卡的顺序是从下到上: 我希望它是从上到下的,这意味着 tab0 位于顶行,tab60 位于底行。 代码: import javax.swing.JFrame; im
这类似于问题How to build a Google-chrome tabs and menubar interface in Java Swing? (我想完成同样的任务),但更重要的是:如何将组
我想将 JTabbedPane 放在中间,单击我想要更改的任何选项卡将反射(reflect)在选项卡 Pane 的上方和下方面板中。 我尝试过,但它只适用于下面的面板。 如何克服这个问题?请帮助我。
我创建了一个 Java 选项卡式 Pane 。在选项卡式 Pane 中,我创建了一个名为“视频”的选项卡。我希望每当我单击视频选项卡时,视频都会自动在选项卡面板本身上播放。我可以这样做吗?如果是,请告
我有一个很长的数据列表要在 jtabbedpanel 上显示,向下滚动数据时,顶部的选项卡式面板名称将不可见。我怎样才能使选项卡式面板选项卡在顶部可见,甚至在向下滚动? 任何人都可以帮助我解决这个问题
我进行了快速研究来解决这个问题,但到目前为止我没有发现任何与此相关的信息。我将一张图像放入一个 TabbedPane 对象中,但是当我尝试将此图像与 TabbedPane 内的标签中心对齐时,它“不起
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 9 年前。 Improve th
我是一名优秀的程序员,十分优秀!