Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between applets and SWING?

Tags:

java

applet

swing

What is the difference between applets and SWING?

like image 954
sevugarajan Avatar asked Dec 17 '09 04:12

sevugarajan


People also ask

Which is better applet or Swing?

We cannot compare APPLET with SWING. - running it from a Web browser, for it we need to create an HTML file so it can be visualized from Web browser, We can compare SWING with AWT. We could extend Applet from AWT package too, but SWING (JAPPLET) provides a more modern set of graphical user interface (GUI) components.

What is difference between Swing and AWT?

The key difference between AWT and Swing in Java is that AWT is Java's conventional platform-dependent, graphics and user interface widget toolkit whereas Swing is a GUI widget toolkit for Java which is an extension of AWT.

What is the difference between applets and applications?

An application program is needed to perform some tasks directly for the user. An applet program is needed to perform small tasks or part of them. It cannot run on its own; it needs JRE to execute. It cannot start on its own, but it can be executed using a Java-enabled web browser.

How are applets related to Swing components?

Swing-based applets are similar to AWT-based applets, but with an important difference: A Swing applet extends JApplet rather than Applet. JApplet is derived from Applet. Thus, JApplet includes all of the functionality found in Applet and adds support for Swing.


2 Answers

See Applets

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a page. When you use a Java technology-enabled browser to view a page that contains an applet, the applet's code is transferred to your system and executed by the browser's Java Virtual Machine (JVM).

See Swing (Java)

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

Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit. Swing provides a native look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform.

like image 110
rahul Avatar answered Sep 28 '22 01:09

rahul


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

A swing is a piece of playground equipment usually consisting of a seat suspended by two chains or ropes. It's quite fun. :)

In all seriousness, though, Swing is a Java GUI library. It provides components such as buttons and text fields. You can use Swing components in an applet.

like image 25
Jeff Avatar answered Sep 28 '22 00:09

Jeff