Results 1 to 3 of 3

Thread: java.applet and java.applet.Applet

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Answers
    4

    java.applet and java.applet.Applet

    What is the difference between java.applet and java.applet.Applet?
    what is the difference between swing and awt?


  2. #2
    Junior Member
    Join Date
    Oct 2007
    Answers
    2

    Re: java.applet and java.applet.Applet

    difference btwn swing and awt...

    Swing made of pure java components and awt is made of c.Awt uses some system resources for executing so they called awt as heavyweight component.Swing is a lightweight component.Awt depends on platform in some cases.Tats only swing becomes so popular.


  3. #3
    Junior Member
    Join Date
    Jul 2007
    Answers
    1

    Re: java.applet and java.applet.Applet

    Swing and AWT difference:

    The main difference between Swing and Awt is that Awt components are peer components to the native widgets. In other words, when you allocate a Button, the java code uses a native component that the OS knows about for that button. All drawing and event handling happens at the OS level. (ie Windows or X Windows code is handling those two areas). AWT listens for events, and calls your hooks for you to interact with them. This implemenation is usually referred to as a heavyweight component. AWT components are heavyweight.

    Swing is pure Java. Most of the components that Swing uses are referred to as lightweight. Both drawing and events are handled by Java code. This makes applications much more portable, Primiarily, because heavyweight event notification is dependant on the OS' implementation. However, since drawing is done by Java code this places a lot of burden on performance of java. In 1.4 swing performance is a lot faster than in previous versions. (Actually, this will be more true in 1.4.1 as there is a bug that Sun is working on that degrades performance of all Java apps using 1.4). You can intermix the AWT and Swing. Heavyweight and lightweigh components in the same application, but there are some limitations to doing that. Swing is very flexible, and very nice to work with. (Some days ;-)

    Finally, another major difference is that AWT does not support fancy widgets like tables, trees, or formated text components. AWT was originally designed to be very simple. And, it is, but you don't get very useful widgets with it, IMHO. You could try using SWT by IBM which is like AWT in the fact that it too is heavy weight, and it provides more up to date pallette of widgets. It's not as nicely designed as Swing.


    Sam...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact