[Reserved] Why use Java to develop desktop applications is relatively small

This is my javafx these days with the development of desktop applications when thought, because although javafx lot more than really pit like C #, but after accustomed okay, and it's time to compile, use everywhere really won my heart. But why do out of fashion:

Author: bell

Source: https: //www.zhihu.com/question/19711713

Java desktop programs, and many, one of the most well-known than the Eclipse. Under Linux and Mac, the proportion is much higher than the Java program in Windows.

However, "Java is not suitable to write desktop applications," the argument does make sense, the main argument of the background is the development of enterprise desktop applications for use under Windows. Due to some of the history and location, for this GUI program needs, Java obvious advantages, disadvantages more obvious.

This thing had to Java from the traditional "cross-platform consistency" Speaking.
When writing the logic behind the cross-platform is a good thing. Many companies are in Windows development, deployment in Linux, convenient.
But when it comes to GUI, cross-platform became a "look beautiful" thing. In theory, I wrote a window in Windows and Mac alike can use, that is a wonderful thing ah. But in fact, each platform provides GUI controls more or less a little different, insist on a cross-platform, trouble came, which controls how much support, how to support it.

A beginning, Java is the idea: that simple ah, why not have native controls, so as not to cross-platform support is not chant, but also adhere to the principle, but also begs the question. This generation of library gui, awt, was born.
Because Java is the beginning of a tendon want to promote Applet, but "the way" also supports local applications, designed so can not say inappropriate, after all, HTML is the same idea, only support a few basic controls.
But for those who want to develop more complex interface, it is in trouble. Want a tree right, I'm sorry, are not supported; it wanted progress bar, I'm sorry, is not supported. Delphi and VB stood next to things so easy, why brother by this gas ah.

As a result, Java also feel justified. But again, cross-platform, but also provides a rich set of controls support, it is only a fresh start, beginning with the second approach: Their hands and clothing, to rewrite their own set of GUI controls, instead of the operating system's native controls. This generation gui library called swing.
It also wants a "radical" ideas to solve the problem, but it comes at a price.
One is the cost of efficiency. We can refer to the same idea of another product --flash. In order to achieve vector animation, in that flash small box, a map is counted out by frame. The next thing we know: the very complex flash animation consume cpu; iPhone's say you too much power, and I do not support; Adobe said, All right, I do not bother to toss the mobile version of flash.
Draw out their own controls with native controls can not, after all, than efficiency, especially in the early Java optimization is still not perfect time. Moreover, the sole purpose of self-reliance platform compatible, not for better results, how to think how this thing actually lose.
The second is the effect of the price. Painted himself after all, only analog controls, or there will be details of the differences. Such as the famous frosted glass effect, this is not a simple set of styles can be set out.
Furthermore, each platform style controls should not, even though swing provides several appearance, but most programs for the lazy or consistent cross-platform considerations, or use the default appearance. The default appearance is inconsistent with the platform it would not be the main problem is not the soil than the platform effect. I used the win7, a program not let me feel back to xp era, felt very clogging.

In this way, the gang discuss, and figure out a new idea: to do the adaptation. This control platform, direct use, ensure efficiency; no, recycling wheels, guarantee available. In this way, swt come out. The eclipse gui is based on this.

@ Feng East: On the other hand, even if each platform supported by more or less control also some differences. Such as the same is a text box, Windows and Mac (Cocoa) to treat non-English input method of semantic choice of words is different. Another example of processing both focus-lost also different. In fact, it is difficult to do so SWT Swing as cross-platform. Cross-platform What, after all, can do the greatest common divisor, such as x86 support level 4, Unix only two. But that is not in everyone agrees. In the UI level but no one can agree a function without an operating system.

In addition to the technology itself, there is the problem of an industry around there is also a GUI control environment, no rich areas, support for industry control, combat technology itself will be greatly reduced. Java and ecology of this area is weak.

In summary, if a GUI program using Java, usually have these features:
really want a cross-platform
to interface requirements and do not have much effect, nor is the bottleneck interface efficiency
compared to other GUI tools for Java developers more Familiar with

For example, some of the tools of management interface, it is consistent

Guess you like

Origin www.cnblogs.com/jiading/p/11877285.html