what is the diff's between swing and applet?

Answers were Sorted based on User's Feedback



what is the diff's between swing and applet?..

Answer / sidhu

Component
Swing :Swing is light weght Component
Applet : Applet is heavy weight Components

Look and feel
Swing: Using UIManager swing have look and feel according
to user view u can change look and feel
Applet: Applet Does not provide this facility

Compile
Swing : swing uses for stand lone Applications ,Swing
have main method to execute the program
Applet : Applet need HTML code for Run the Applet

Swing : uses MVC Model view Controller
Applet : not

Swing : swing have its own Layout ..like most popular Box
Layout
Applet : Applet uses Awt Layouts..like flowlayout

Thread
Swing :Swing have some Thread rules
Applet :There is no any rule

Is This Answer Correct ?    145 Yes 11 No

what is the diff's between swing and applet?..

Answer / jeena joy

Swing is a light weight component whereas Applet is a heavy
weight Component..Applet Does not require main
method ,instead it needs init method.

Is This Answer Correct ?    136 Yes 18 No

what is the diff's between swing and applet?..

Answer / bindhu

Swing is a set of classes under JFC that provide
lightweight visual component , enable creation of
attractive GUI. But Applet is heavyweight component and
needs web browser or tool known as AppletViewer.

Applet have no main method, but swing have.

Is This Answer Correct ?    90 Yes 5 No

what is the diff's between swing and applet?..

Answer / manikandan

swing is a light wight component.

Is This Answer Correct ?    72 Yes 22 No

what is the diff's between swing and applet?..

Answer / karthik

Apple :to execute Applet programe we should need any one
browser like Appletviewer,web browser.
Because Applet using browser container to run and all
action control with in browser container

swing :to execute swing no need any browser By which we can
create stand alone application
But Here we have to add container and maintain all action
control with in frame container


Applet : we dependent on brower to execute and action


swing : own

simply Instance problem

Is This Answer Correct ?    46 Yes 7 No

what is the diff's between swing and applet?..

Answer / rani

swing:all classes start with J letter
applet:not

swing:componants added on container
applet:no componants addedon container

swing:u can provide tooltiptext to every componants using
metod setToolTipText();
applet:not

Is This Answer Correct ?    32 Yes 3 No

what is the diff's between swing and applet?..

Answer / madhavsingh

applet: the components of applet are from underlying
operating system .
swing : Swing creates its own component.

Is This Answer Correct ?    31 Yes 14 No

what is the diff's between swing and applet?..

Answer / vidya deshmukh

Swing is lightweigt process and run through main() method
in case of browser

Applet is heavyweight process and run within only browser
or with the help of browser

Is This Answer Correct ?    20 Yes 6 No

what is the diff's between swing and applet?..

Answer / 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

what is the diff's between swing and applet?..

Answer / raj sharma

for applet we use java.* class file and for swing we use
javax.* class file.

Is This Answer Correct ?    16 Yes 8 No

Post New Answer

More Swing Interview Questions

how can u handle runtime exceptions in java plz explain with examples briefly?

3 Answers   Fujitsu, IBM,


What is swing control in java?

0 Answers  


What is the class in swing to change the appearance of the frame in runtime?

0 Answers  


Is swing part of core java?

0 Answers  


What is the difference between a scrollbar and a jscrollpane ?

0 Answers  






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

0 Answers  


What is javax swing joptionpane?

0 Answers  


What is swing in java javatpoint?

0 Answers  


What are swing components?

0 Answers  


Why swing is used in java?

0 Answers  


What is difference between swing and awt?

0 Answers  


What is swing used for?

0 Answers  


Categories