使用 Java 创建 Windows Metro 风格的应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7454019/
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-30 20:01:58  来源:igfitidea点击:

Creating Windows Metro style apps with Java?

javawindows-8windows-runtime

提问by Harshveer Singh

I know how to create small desktop applications in Java. I want to know, can I make Windows Metro style apps in Java? Because on the web only C++/C/C#/JavaScript etc. are mentioned. If yes can you please give me some reference for a quick start. If not which one will be easiest language to start?

我知道如何用 Java 创建小型桌面应用程序。我想知道,我可以用 Java 制作 Windows Metro 风格的应用程序吗?因为在网络上只提到了 C++/C/C#/JavaScript 等。如果是,请给我一些参考以快速入门。如果不是,哪一种语言最容易上手?

采纳答案by ReinstateMonica Larry Osterman

You can only create metro style apps with C#, VB, JavaScript and C++. There is currently no support for authoring metro style applications with Java.

您只能使用 C#、VB、JavaScript 和 C++ 创建 Metro 风格的应用程序。目前不支持使用 Java 创作 Metro 风格的应用程序。

回答by SpeedBirdNine

You cannot make metro style apps with Java.

你不能用 Java 制作 Metro 风格的应用程序。

For the other part of your question, regarding starter's guide and which language is easy, MSDNhas a starter's guide which helps building new metro style apps, this, thisand thisshould be helpful.

对于您问题的另一部分,关于入门指南和哪种语言容易,MSDN有一个入门指南,可帮助构建新的 Metro 风格应用程序,this, thisthis应该会有所帮助。

And which language is easiest, well it depends on the developer, someone who has been developing .NET or WPF or Windows Forms applications maybe more comfortable with he familiar environment and may prefer developing using C++ and XAML or VisualBasic, depending on what he has been using before, while someone coming from web development may prefer javascript.

哪种语言最简单,这取决于开发人员,一直在开发 .NET 或 WPF 或 Windows Forms 应用程序的人可能更熟悉他熟悉的环境,并且可能更喜欢使用 C++ 和 XAML 或 VisualBasic 进行开发,这取决于他一直在做什么使用之前,而来自网络开发的人可能更喜欢 javascript。

For new developers, i would recommend using C# and XAML, but again it is my choice, and not everyone will agree with it.

对于新开发人员,我会推荐使用 C# 和 XAML,但这也是我的选择,并不是每个人都会同意。

Hereis another link which points to guides at MSDN, and adds some additional detail.

是指向 MSDN 指南的另一个链接,并添加了一些额外的细节。

回答by svick

WinRT is still based on COM, so you should be able to access it from Java using something like the Java-COM bridge. Using that would probably be quite hard (you'd have to use strings for method names etc.).

WinRT 仍然基于 COM,因此您应该能够使用Java-COM bridge 之东西从 Java 访问它。使用它可能会非常困难(您必须使用字符串作为方法名称等)。

If you wanted to use WinRT comfortably from Java, that would require modifying the Java runtime and possibly also the compiler to make them aware of WinRT types.

如果您想从 Java 舒适地使用 WinRT,则需要修改 Java 运行时,可能还需要修改编译器,使它们能够识别 WinRT 类型。

回答by gyurisc

I believe you will not be able to use Java and WinRT. The best option for you to try is C#, because this is the language that is closest to java, in my opinion.

我相信您将无法使用 Java 和 WinRT。您可以尝试的最佳选择是 C#,因为在我看来,这是最接近 java 的语言。

回答by diegolin

Actually you can quite easily write a metro style web application by using a CSS library like this one: http://metroui.org.ua/

实际上,您可以使用像这样的 CSS 库轻松编写 Metro 风格的 Web 应用程序:http: //metroui.org.ua/

With this CSS, it is possibly to generate plain old HTML with Java on the server side (e.g. via a servlet) and then reverence the CSS classes.

使用此 CSS,可以在服务器端(例如通过 servlet)使用 Java 生成普通的旧 HTML,然后尊重 CSS 类。

I did this by using the org.apache.ecs library (it's very old but it works pretty good).

我通过使用 org.apache.ecs 库(它很旧,但效果很好)做到了这一点。

回答by user2678408

C# and Java are similar, but with different Frameworks. Look into developing Metro Style apps in C#. Remember to sign up for a developer's license for Windows Store Apps!

C# 和 Java 很相似,但具有不同的框架。研究用 C# 开发 Metro 风格应用程序。记得注册 Windows Store Apps 的开发者许可证!

回答by funkybro

You could write your app in Java and cross compile into JavaScript using GWT. We do this successfully with a couple of Windows (Phone and Desktop) apps. Additionally, the code can be shared with your iOS and Android ports.

你可以用 Java 编写你的应用程序,然后使用 GWT 交叉编译成 JavaScript。我们使用几个 Windows(手机和桌面)应用程序成功地做到了这一点。此外,该代码可以与您的 iOS 和 Android 端口共享。

回答by Raouf MAYATA

here what i found in sourceforge.net
http://sourceforge.net/directory/os:windows/freshness:recently-updated/?q=slibrarythis is the most close ui to metro theme i saw.

这是我在 sourceforge.net 中找到的
http://sourceforge.net/directory/os:windows/freshness:recently-updated/?q=slibrary这是我看到的最接近地铁主题的用户界面。