How can I create a “modern looking” Java desktop a

2019-03-08 03:01发布

Similar questions to this are asked periodically, but many of these answers are outdated.

I need to build a cross-platform desktop application in Java with a GUI of comparable quality to contemporary desktop apps.

Swing is the default choice, but I have yet to encounter a Swing application that didn't look, at the very least, quite dated and clunky (subjective, I know, but with GUIs it's hard to avoid aesthetic judgements).

I notice that the new Bitcoin client now uses QT with Java bindings, and does have an attractive user interface, but this has the disadvantage that it is no-longer pure Java.

So much of what I find when I search for Swing-related libraries is 5 years old or older, even though the aesthetics of desktop applications have evolved significantly since then.

If you needed to build a Java desktop application from scratch, what would you use for its GUI?

9条回答
Root(大扎)
2楼-- · 2019-03-08 03:49

Have you looked into JavaFX 2.0? It is designed to interop easily with Swing, and has many modern 'good looking' controls.

Also, as lrAndroid mentions, a Swing app can look like a native app if you set the system look and feel with:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
查看更多
相关推荐>>
3楼-- · 2019-03-08 03:50

I know this question is old, but if you don't want to use FX and still want to use Swing, then try MacWidgets, i've used it on a couple projects. It's very light, and looks great. Below is an old project i was working on, over time i've perfected using macwidgets and now use it internally in my company.

http://www.digitalhand.net/projects/jdataanalyzer/mainGUI.png

查看更多
相关推荐>>
4楼-- · 2019-03-08 03:52

QT is quite extensive but also very big (bloated) and complex. There is also the SWT library being used by open office for instance. SWT uses native UI widgets for buttons, tables etc where as Swing emulates them.

However, the trend is clearly towards writing rich client applications for the browser using HTML and Javascript. Both of these have made huge strides in the past few years.

HTML5 specifically targets rich client applications with features such as better forms and local database to support disconnected scenarios (note that this last feature is not standardized yet but it is implemented by all latest browsers).

Javascript has now powerful libraries with jQuery and its many plugins. There are even languages like Coffeescript which can be used to produce Javascript with a simpler and more powerful syntax.

There's also no need for such apps to connect to an outside server. Small footprint local servers (eg: jetty, node.js, ...) and databases (SQLite, H2,...) can be installed on the client to make a completely self contained application.

查看更多
登录 后发表回答