Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Andrew Thompson" Subject: Re: AWT versus Swing Message-ID: <73c31f865ea4a@uwe> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: References: Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 72 Date: Wed, 27 Apr 2011 15:35:43 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918543 96.60.20.240 (Wed, 27 Apr 2011 10:35:43 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:35:43 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1852 To: comp.lang.java.gui Daniel Kraft wrote: .. >I've all times used AWT for UIs in Java, despite the fact that all the >other world seems to be using Swing. I do not really "need" these fancy >Java-look and instead prefer the plain, platform-common look instead; I often call the platform's default PLAF - so the end user can feel mostly at home, while also enjoying the benefits of such GUI components as JTables and JTrees. From the development side, I like the 'throw away simplicity' of JOptionPane, and the ease of developing using GUI components that will render HTML. I code AWT as well, but primarily for applets that must be 1.1 compatible (I write too many of those, it seems). Any 1.2+ project, I would generally use Swing. >also, I think Swing is really sensible slower than AWT .. Is it? Even if Swing components need 'a few microseconds' longer to construct* these sorts of things can mostly be done transparently on a thread in the background. Once constructed and displayed, I find Swing components every bit as fast as AWT, to show, hide or update. * I am not too sure, have not seen/done any benchmarks. >..and if your >platform already has fast and stable widgets, why not use them? Roedy put forward some good reasons, not that Swing and PLAF's are a rock solid solution either (I suspect every API has bugs). >On the other hand, I already read some rumours that AWT will be >deprecated somewhere in the future, which I can't believe as Swing is >based on AWT, AFAIK. I cannot imagine that AWT ..Buttons and TextFields would *ever* be removed from the API. And, as you noticed, a lot of a Swing GUI's functionality (most events, most layouts, colors, images, printing, basic D'n'D, graphics/environment..) uses AWT classes and packages. >So do you guys have any information/comments/corrections about my >assumptions or any real objections against using AWT or are there even >others who prefer AWT, too? Most people are coding for the server side, very little AWT/Swing/SWT or J2ME, but by far Swing is the chosen widget kit. One good reason is that if you ask people about a problem with Swing, you are much likely to find someone that knows the answer! A lot of people have forgotten the 'subtleties' of AWT GUI coding. -- Andrew Thompson http://www.athompson.info/andrew/ Message posted via JavaKB.com http://www.javakb.com/Uwe/Forums.aspx/java-gui/200706/1 --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24