What is the difference between applets and SWING?

What is the difference between applets and SWING?

+7
java swing applet
source share
7 answers

See Applets

An applet is a program written in the Java programming language, which can be included in an HTML page, much of the image is also included in a page. When you use a Java browser with technology support to view a page containing an applet, the applet code is transferred to your system and executed by the Java Virtual Machine (JVM) browser.

See Swing (Java)

Swing is a widget toolkit for Java. This is part of the Java Sun Microsystems Foundation Classes (JFC), an API for providing a graphical user interface (GUI) for Java programs.

Swing was designed to provide a more complex set of GUI components than the previous abstract Toolkit window. Swing provides the look and feel that emulates the look and feel of multiple platforms, and also supports a plug-in look that allows applications to have a look and feel unrelated to the underlying platform.

+9
source share

An applet is a small program that often runs in a Java browser plugin.

A swing is a piece of equipment for playgrounds, usually consisting of a seat suspended by two chains or ropes. This is pretty fun. :)

Despite its seriousness, Swing is a Java GUI library. It provides components such as buttons and text fields. You can use Swing components in the applet.

+4
source share

Applets will be downloaded in the client’s web browser and run locally where swing has a set of APIs for developing GUI components and can act as stand-alone applications.

0
source share

Short answer: Applets are designed for small functionality that runs on a web browser and downloads on demand. Swing is a collection of user interface components, such as text fields and windows, that are designed to be built by the developer for use on the desktop.

Long answer: see adamantium answer.

0
source share

I think the confusion is related to all the terminology that you encountered when creating applets.

Applet is the common name for a program that runs in the Java sandbox in a web browser. This is also a specific Java class ( java.applet.Applet ). The write class of this program should extend the applet.

Initially, applets (prior to Java version 1.1) could only use AWT user interface components .

Since Java components of Swing version 1.3 can be used instead. In this case, your class should extend JApplet .

0
source share

Swing: - Swing is an easy component. Swing has its own layout, like most popular box layouts. Swing has some flow rules.

Applet: -

An applet is a heavy component. An applet uses an AWT layout, such as flowlayout. An applet has no rules.

0
source share
  • Swing is light weight. An applet is a heavy component.

  • The swing looks and feels according to the custom look, you can change the look using the UIManager.
    The applet does not provide this feature.

  • Swing uses for stand-alone applications, Swing has the main method for running the program.
    An applet needs HTML code to run an applet.

  • Swing uses the MVC Model view Controller.
    No applet.

  • Swing has its own layout, such as the most popular layout format. The applet uses AWT layouts such as flowlayout.

  • Swing has some Thread rules.
    An applet has no rule.

  • Swing: There is no browser required to run Swing. With the help of which we can create a standalone application. But here we have to add a container and support all actions using frames in the container.


Applet : To run the Applet program, we need a browser, such as AppletViewer, a web browser. Because Applet uses a browser-browser to run and all the action controls in the browser container.

-one
source share

All Articles