java - 开发Linux桌面程序,SWING和AWT,哪个更容易入门?
黄舟
黄舟 2017-04-18 10:38:31
0
6
1015
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(6)
黄舟

To get started, swing is of course the easiest.
You should know the kettle of eclipse and pentaho. Both of these use AWT.
I have also come into contact with AWT. Personally, I think AWT is quite cumbersome, and you have to recycle resources yourself.
I did a lot of research on swing when I was in college. But now I have almost forgotten all about it! Because I don't need it at work.
Some Java people around me simply ignore swing, because most of them use Java as server-side programs.

If you are just curious about desktop application development, I personally suggest that there is no need to learn it. I am not belittling AWT and swing. The existence of anything is valuable. We still rely on them for things like eclipse!

After all, time is limited, so it is recommended that you study more technologies related to your work. Of course, if your job is mainly to develop desktop applications, it is recommended to learn swing first.

A few years ago, I met a swing master who used swing to write an application that looked exactly like QQ. From the appearance, it is impossible to tell that he wrote QQ himself. But according to him, when he was studying swing, he read a book that was about as thick as the Xinhua Dictionary. I forgot the name of the book.

Let’s get started with programming. No matter what programming language it is, it’s easy to get started, but you need to go deeper. If you want to be a master, it depends on your personal understanding and dedication!

小葫芦

Swing and AWT are not separable. The events used by Swing are events in AWT - but the AWT component function is too weak. It is recommended to start with Swing, which is very helpful for mastering GUI programming

洪涛

javafx?

小葫芦

Swing is very powerful, Sun’s language development skills are not limited, and the original code is very elegant. However, swing's operating efficiency is quite average, the interface it creates is not very beautiful, and it consumes a bit of memory. I haven't used swt very much. I asked a colleague at my original unit who has used it for advice. The colleague said that it is not recommended because the scalability is too small.

Peter_Zhu

Don’t use Java. The default control style and font rendering of Java's GUI components are different from the system defaults, so the interface will be more abrupt. And it runs very slowly. In fact, apart from Eclipse and NetBeans, there are only a handful of good-looking Java desktop GUI programs (and they are all slow). The most suitable for Linux GUI development is using C++ and Qt.

左手右手慢动作

If it’s easier, I suggest you try the HTML solution.

"Browser runtime" is the simplest cross-platform UI implementation, and HTML is the simplest cross-platform UI language.

Electron and NW.js are two solutions based on HTML+Node.JS:
An obvious disadvantage of using Electron and NW.js to develop cross-platform desktop applications is that the generated application installation package is too large, often dozens of MB . After all, it comes with a Chromium browser environment. When the application is working, it is equivalent to opening a browser instance, which is too resource-consuming.

HTML+PHP+SQLite is another solution:
Deploy PHP, the HTML preprocessor with built-in HTTP server and SQLite database, to the client (including Android/iOS), and use it with the browser or WebView to develop a standalone server that can run offline Application:

php -S 127.0.0.1:8080 -t /www
xdg-open http://127.0.0.1:8080

Because the browser is directly called to access the local PHP service, there is no need to package the browser runtime, so the software packaging of the HTML+PHP-based solution will be much smaller. Moreover, the PHP source code can be exported to opcode using PHP7's opcache.file_cache Protect.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template