Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: should I use java.awt.* only or also use javax.swing in applets? Date: Wed, 04 May 2011 19:10:15 -0400 Organization: albasani.net Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net MODcVU3IYqlssKPvx4zVIvTp51nN6PchSXD34txTDI/nyfXcuUEqlL4Ghrcypr/Yp4klUFGyBg9uERBjE1KIGQ== NNTP-Posting-Date: Wed, 4 May 2011 23:09:03 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="71eCRDR9plZhur80x1Q/RSZ3vgNP+NPCH1umKtY4lkPbGJHL2XjuHG795aqn+v/+D9iiQl+0roFN1LlEpAQ8wGEH58aelvavvI8fBL9CRMb5bsCWRbg96A1UDPnArVE6"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: Cancel-Lock: sha1:wAqhprdywi5ecNGnX9t9rZGLnq0= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3524 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