我可以在同一个Swing应用程序中使用两种不同的外观吗? [英] Can I use two different look and feels in the same Swing application?

查看:152
本文介绍了我可以在同一个Swing应用程序中使用两种不同的外观吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Flamingo功能区和Substance Office 2007外观。

I'm using the Flamingo ribbon and the Substance Office 2007 look and feel.

当然现在每个控件都具有这样的外观和感觉,甚至是对话框上的那些。

Of course now every control has this look and feel, even those on dialog boxes.

我想要的是类似于Office 2007,其中的色带具有Office 2007外观,但其他控件保留其原生Vista / XP外观。

What I want is something like in Office 2007, where the ribbons have their Office 2007 look, but other controls keep their native Vista/XP look.

是否可以为某些控件分配不同的外观?也许使用某种链接或代理外观?

Is it possible to assign certain controls a different look and feel? Perhaps using some kind of chaining or a proxy look and feel?

推荐答案

我刚刚发现:因为 Substance 5.0 SKIN_PROPERTY 可用。

I just discovered: Since Substance 5.0 the SKIN_PROPERTY is available.

它允许为不同的<$分配不同的皮肤c $ c> JRootPanes (即 JDialog JFrame JInternalFrame

It allows assigning different skins to different JRootPanes (i.e. JDialog, JFrame, JInternalFrame)

一个小技巧:我重写 JInternalFrame 以删除额外的边框和标题窗格使它看起来就像一个无边框面板。这样就可以创建一种印象,表单/对话框的不同部分具有不同的外观。

A little trick: I override JInternalFrame to remove the extra border and the title pane so that it looks just like a borderless panel. That way it is possible to create the impression, that different parts of a form/dialog have different looks.

这篇关于我可以在同一个Swing应用程序中使用两种不同的外观吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆