Re: should I use java.awt.* only or also use javax.swing in applets?
steveh44 wrote:
folks,
newbie here.
I am learning applets. should one stick to java.awt.* and only extend
Applet or go for Japplet instead and pull in swing?
When I looked at some applets, most seem to be based on Applet, not
JApplet.
Basically I am asking, if I want to make sure my applet run best and
on most browser, should I just stick to awt and not include any swing
stuff? I know if I extend JApplet I can still use awt classes and
methods if I want to.
Speaking only from my own personal preference, I find the Swing world more
hospitable. I don't know that it makes a real difference from a deployment
perspective either way, but Swing components are rather more internal to the
Java campus. AWT components more explicitly involve platform resources.
I realize that I'm hideously over-generalizing, but I intend to convey the
summary and taste of my bias rather than to describe the details.
In any event (haha), the Swing programming model is fairly clean and opens up
nicely to a lot of the libraries that handle graphics, printing, transforms,
whatever.
The real benefit is its event-driven mechanism and the model-view-controller
(MVC) perspective.
Naturally there are java.awt... libraries involved in Swing programming.
We're really only comparing the component model parts here.
--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg