What does the “J” in JApplet mean?

后端 未结 4 505
有刺的猬
有刺的猬 2020-12-11 23:03

What does the \"J\" in JApplet mean?

4条回答
  •  清歌不尽
    2020-12-11 23:37

    The 'J' was first put out by the KL Group (now quest.com) whose revolutionary BWT forms the basis of today's Improved AWT called Swing /JFC.

    So, it comes from the ancestor of today's KL JClass:
    (not so, according to TofuBeer's answer: I leave the rest as a Community Answer because it details what was JClass, but the 'J' may not come at all from the integration of their library into Swing.)

    JClass SwingSuite, a new set of extensions and enhancements for Swing in Sun Microsystems, Inc.'s Java(TM) Development Kit (JDK(TM) version 1.2): it coincides with Sun's announcement of the availability of JDK 1.2 made today during the Java(SM) Business Expo(SM) in New York.

    JClass JavaBeans are available in many popular Java IDEs and are the essential components used by professional and corporate developers around the world.
    JClass 3.6 includes "J" versions, which work with the javax.swing package enabling the development and deployment with JDK 1.2 today.


    From JClass 3.6 to 4.0 Porting Guide and KL Group Releases Swing Update for JClassLine (march 1998):

    To accommodate the various types of environments Java developers may be using, we have developed versions of our JClass products that can be used for specific Java Development Kits (JDKs). The following lists the differences between the different versions:

    • "J" version: uses JDK 1.1 + Swing 1.1 (JDK 1.1.8 + Swing 1.1.1 are recommended)
    • "K" version: uses Java 2 (JDK 1.2.2 is recommended)

    JClass 3.6 and prior versions used a slightly different letter scheme, which is as follows:

    • "T" version: uses the JDK 1.0.2 API and implements "Transitional" JavaBeans
    • "Unlettered" version: uses the JDK 1.1.x and incorporates full JavaBean implementation
    • "S" version: uses the JDK 1.1/Swing 1.0.3
    • "J" version: uses JDK 1.2 or JDK 1.1 with Swing 1.1

    A bit of general context:

    From The Basic Java Applet and JApplet:

    The AWT (Abstract Windowing Toolkit) has been part of Java from the beginning, but, almost from the beginning, it has been clear that the AWT was not powerful or flexible enough for writing complex, sophisticated applications.

    This does not prevent it from being useful -- especially for applets, which are generally not as complex as full-scale, independent applications.

    The Swing graphical user interface library was created to address the problems with the AWT. With the release of Java version 1.2, Swing became an official part of Java. (Versions of Java starting with 1.2 are also called, rather confusingly, "Java 2.")

    There are still good reasons to write applets based on the AWT, such as the lack of support in many Web browsers for Java 2. However, at this point, anyone writing a stand-alone graphical application in Java should almost certainly be using Swing.

    The classes that make up the Swing library can be found in the package javax.swing. Swing includes the class javax.swing.JApplet to be used as a basis for writing applets.

    JApplet is actually a subclass of Applet, so JApplets are in fact Applets in the usual sense.

    However, JApplets have a lot of extra structure that plain Applets don't have. Because of this structure, the painting of a JApplet is a more complex affair and is handled by the system.

    So, when you make a subclass of JApplet you should not write a paint() method for it. As we will see, if you want to draw on a JApplet, you should add a component to the applet to be used for that purpose. On the other hand, you can and generally should write an init() method for a subclass of JApplet.

    Swing is a large set of components ranging from the very simple, such as labels, to the very complex, such as tables, trees, and styled text documents.
    Almost all Swing components are derived from a single parent called JComponent which extends the AWT Container class.
    Thus, Swing is best described as a layer on top of AWT rather than a replacement for it.
    If you compare it with the AWT Component hierarchy, you will notice that for each AWT component there is a Swing equivalent with prefix “J.
    The only exception to this is the AWT Canvas class, for which JComponent, JLabel, or JPanel can be used as a replacement. Many Swing classes have no AWT counterparts.

提交回复
热议问题