Synth LaF 不同面板样式

发布于 2024-09-16 12:14:59 字数 147 浏览 1 评论 0原文

我有一个带有两个 JPanel 的应用程序,它们必须具有不同的样式。我使用 Synth LaF,但我不知道如何在一个 xml 文件中拥有两种不同的样式。我定义了一种样式并将其绑定到“面板”,但两个面板看起来很相似。是否有可能定义更多样式并让合成器知道应该在哪个面板上使用哪种样式?

i have an app with two JPanels and they must have different styles. I use the Synth LaF and I don't know how to have two different styles in one xml file. I define a style and bind it to "Panel" but then both panels look alike. Is there a possibility to define more styles and let synth know which one it should use on which panel?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

满地尘埃落定 2024-09-23 12:14:59

摘自 http://download.oracle.com/javase/tutorial/uiswing /lookandfeel/synth.html

<绑定>元素...
类型是“名称”或“区域”。如果 type 是名称,则使用 component.getName() 方法获取名称。 ...

因此,将样式绑定到名称,并通过调用 setName 为面板提供名称

extracted from http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/synth.html:

The <bind> Element ...
type is either "name" or "region." If type is a name, obtain the name with the component.getName() method. ...

So, bind the style to a name, and give your panel names by calling setName

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文