what is the diff's between swing and applet?

Answer Posted / naresh

swing
The Swing toolkit includes a rich set of components for
building GUIs and adding interactivity to Java applications.
Swing includes all the components table controls, list
controls, tree controls, buttons, and labels. It includes
rich undo support, a highly customizable text package,
integrated internationalization and accessibility
support..Swing supports numerous look and feels, including
the ability to create your own look and feel The ability to
create a custom look and feel is made easier with Syntha
component toolkit without the basic user interface
primitives such as drag and drop, event handling,
customizable painting, and window management.
Swing is part of the Java Foundation Classes (JFC)The JFC
also include other features important to a GUI program, such
asto add rich graphics functionality and the ability to
create a program that can work in different languages and by
users with different input devices.
the features that Swing and the Java Foundation
Classes provide.:
1. Swing GUI Components:
The Swing toolkit includes a rich array of components: from
basic components ,such as buttons and check boxes complex
components, such as tables and text. simple components, such
as text fields, offer sophisticated functionality, such as
formatted text input or password field behavior.

2. Java 2D API: Java 2DTM API. Because Swing is built on the
2D package, it's trivial to make use of 2D within Swing
components. Adding images, drop shadows, animations,
compositing — it's easy with Java 2D.
Pluggable Look-and-Feel Support’:
Swing components has a choice of look and feel .The JFC
classes shipped by Sun and Apple provide a look feel that
matches that of the platform. The Synth package allows you
to create your own look and feel. The GTK+ look and feel
makes hundreds of existing look and feels available to Swing
programs.
Data Transfer:
Data transfer, via cut, copy, paste, and drag and drop, is
essential to almost any application. Support for data
transfer is built into Swing and works between Swing
components within an application, between Java applications,
and between Java and native applications.



Internationalization:
This feature allows developers to build applications that
can interact with users worldwide in their own languages and
cultural conventions. Applications can be created that
accept input in languages that use thousands of different
characters, such as Japanese, Chinese, or Korean.
Undo Framework API: Swing's undo framework allows developers
to provide support for undo and redo. Undo support is built
in to Swing's text component. Swing supports an unlimited
number of actions to undo and redo.
The main characteristics of the Swing toolkit:
 platform independent
 customizable
 extensible
 configurable
 lightweight



Applets:
An applet is a Java program that runs in a Web browser. An
applet can be a fully functional Java application because it
has the entire Java API at its disposal.

There are some important differences between an applet and a
standalone Java application, including the following:

*

An applet is a Java class that extends the
java.applet.Applet class.
*

A main() method is not invoked on an applet, and an
applet class will not define main().
*

Applets are designed to be embedded within an HTML page.
*

When a user views an HTML page that contains an
applet, the code for the applet is downloaded to the user's
machine.
*

A JVM is required to view an applet. The JVM can be
either a plug-in of the Web browser or a separate runtime
environment.
*

The JVM on the user's machine creates an instance of
the applet class and invokes various methods during the
applet's lifetime.
*

Applets have strict security rules that are enforced
by the Web browser. The security of an applet is often
referred to as sandbox security, comparing the applet to a
child playing in a sandbox with various rules that must be
followed.
*

Other classes that the applet needs can be downloaded
in a single Java Archive (JAR) file.

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which method of the Component class is used to set the position and size of a component?

563


What are the different components that are used to show a container?

542


What is the use of jfc in java swing?

655


What is swing?

599


What are the advantages of java swing over angular?

488






Which swing methods are thread-safe?

641


Who created the swing?

501


What is the function of internal frame in swing?

611


What is the difference between swing and applet?

546


What is the difference between invokeAndWait() and invokeLater()?

593


What is jpanel swing?

556


What is the process of setting the layout manager?

589


What is jlabel java swing?

531


How to move from one page to another in java swing?

612


How to render an html page using only swing.

591