Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Swing/AWT

Options
  • 10-11-2001 9:21pm
    #1
    Registered Users Posts: 1,176 ✭✭✭


    Whats the story with Swing and applets.
    Some books say only use AWT while ive soon tutorials for applets with swing. Is it that some browsers do not support swing or what?
    I'm developing an application which i would also like to port to an applet, so if i use swing will i be restricting myself. I know of the security constraints of applets these will my effect my program.
    Any help would be appreciated.
    David.


Comments

  • Closed Accounts Posts: 219 ✭✭Bosco


    I thought Swing is supposed to replace AWT isn't it? Better designed and allows the style of the GUI to change to suit the system it's working on? (Or so says my Java book)

    Good question podgeen :) Experts?


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    My guess is that a lot of people wouldn't have the latest JRE installed on their system so it might not support Swing. It would be like coding a website for IE6 that didn't work at all in NS 4.x
    The AWT has been with Java since the start so it's a safer bet.
    I thought Swing is supposed to replace AWT isn't it?
    In a way, yes. AFAIK Swing is an extension of the AWT.


  • Registered Users Posts: 2,281 ✭✭✭DeadBankClerk


    the swing classes suck as JButton and JFrame extend java.awt.Button and java.awt.Frame etc...

    they are packages in the java extended library, javax.swing.*

    they only work on a machine with java2.0 installed


  • Closed Accounts Posts: 37 nucular


    main difference between swing and awt is awt uses the underlying api whatever that may be to draw buttons and the like...

    swing just gets the drawing area and draws the lines and stuff for itself..

    This means that it is much more customisable and less dependant on the underlying infrastructure.

    A java application designed to look a certain way "should" look identical on all platforms even the mac no matter how much it pisses them off j/k :)

    There are many other differences like memory requirements, event handling and stuff but that is one of the main ones.


  • Closed Accounts Posts: 7 ManWithName


    The problem is that most current browsers have a 1.1 JVM in them, without the swing classes. What you can do is use the
    HTML object tag, instead of the applet tag, and set up the object tag to use the JRE plugin. This will prompt the user to download the JRE plugin if they haven't already done so. Then it will run your applet in the plugin instead of the browsers normal JVM. Check out java.sun.com/products/plugin for more details.


  • Advertisement
Advertisement