如何在 Java 程序中获取“功能区”UI 组件,例如 Office 2007 中的组件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1530363/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 16:56:55  来源:igfitidea点击:

How to get a "ribbon" UI component, like in Office 2007, in a Java program?

javauser-interfaceswingribbon

提问by Ankur

I want to create a ribbon-based GUI. I am pretty much a newbie when it comes to Java interfaces, I have used the basic Swing toolkit, but that's it.

我想创建一个基于功能区的 GUI。我几乎是 Java 接口的新手,我使用过基本的 Swing 工具包,但仅此而已。

Can anyone point me in the right direction regarding what to do to get more flexibility with my UI and in particular being able to create a "ribbon"?

任何人都可以为我指出正确的方向,如何让我的 UI 获得更大的灵活性,尤其是能够创建“功能区”?

回答by Daniel Rikowski

Use Flamingofor the Ribbon and Substancefor the Office 2007 look.

使用Flamingo作为 Ribbon 和Substance作为 Office 2007 的外观。

Here's a small preview from Pushing Pixels:

这是Pushing Pixels的一个小预览:

enter image description here

在此处输入图片说明

PS: Not directly related to your question, but if you are new to Java UI programming, make sure you don't miss out on MigLayout.

PS:与您的问题没有直接关系,但如果您是 Java UI 编程的新手,请确保您不要错过MigLayout

Update 2013-11-05:Unfortunately Substantial and its successors are not actively maintained at the moment, although in my experience they are complete and production ready.

2013 年 11 月 5 日更新:不幸的是,Substantial 及其后续产品目前并未得到积极维护,但根据我的经验,它们已经完成并已准备好投入生产。

The current code can be found at Github at Insubstantial/insubstantial. (Where "Flamingo" has been integrated into the "Insubstantial" package)

当前代码可以在 Github 的Insubstantial/insubstantial 找到。(其中“火烈鸟”已被整合到“无形”包中)

Also there seems to be a relatively up-to-date version available as a Maven artefact. (See http://mvnrepository.com/artifact/com.github.insubstantial)

此外,似乎有一个相对最新的版本可用作 Maven 人工制品。(见http://mvnrepository.com/artifact/com.github.insubstantial

Update 2018-09-17:It was reanimated in December 2016, there were Maintenance Updates since February 2017 and now Flamingo is part of Project Radiance.

2018年 9 月 17 日更新:它于 2016 年 12 月重生,自 2017 年 2 月起进行了维护更新,现在 Flamingo 是 Project Radiance 的一部分