Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Any good books for learning Swing or AWT?

Any good books for learning Swing or AWT?
Thread Tools
11011001
Mac Elite
Join Date: May 2001
Location: Up north
Status: Offline
Reply With Quote
Mar 30, 2003, 08:48 PM
 
So ya.. I really, really like Java. It's totally awesome.. it's a breath of fresh air. So, now I would like to do more with it than making cli tools.

Any suggestions on books for learning Swing or AWT? (that is not an xor, so one that covers both is also good)
     
DaGuy
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Mar 31, 2003, 12:36 AM
 
I wasted a good amount of money on this subject a couple of years ago. The only worthwhile reading was:

"The JFC Swing Tutorial: A Guide to Constructing GUIs"

Which I believe is also distributed freely by Sun Micro.

Java is great for command line tools and overall server side programming. But Swing SUCKS



There's no better way of putting it... especially when compared to something as neat as Cocoa.

Be as it may, if you want to learn Swing then the above book should do the trick.
     
depolitic
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Mar 31, 2003, 03:46 AM
 
Swing has traditionally been a major draw back in Java. Prior to 1.4.1 the internals of Swing was broken according to SUN. Now with 1.4.1 SUN redid all the internals of Swing and 1.4.1 Swing applications are much nicer, and zippier. Still not Cocoa speed but respectable. But the applications must be using 1.4.1 not 1.3.1 as many Java apps on the Mac still do. Also since Java 1.4.1 on Mac OSX calls Cocoa GUI elements Java looks the best on Mac OSX.

Swing is rather more complex and labour intensive then using Interface Builder and Cocoa. But it is not impossible to build nice interfaces with Swing. a good point is ThinkFree Office v2.2 which under 1.4.1 looks just smick, and with very little applications hangs. ThinkFree Office v2.2 flickers now and then when it has to refresh the whole page, but still good.

And I have one of the slowest G4 on the market the old 350 Sawtooth.

Best of Luck in your adventure. I would be learning GridBagLayout not as complex as people make out its just like HTML Tables but with a more CSS style logic. Also avoid absolute positioning its tempting but makes your apps ugly across platforms.

As for a good book, the SUN Swing tutorial is really good. But I would also look toward the O'Reily Swing book in 3rd edition or something.
     
cheerios
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Apr 2, 2003, 02:06 PM
 
hit up sun.java.com keep the api's open, and find some tutorials from them. but be prepared, it's retarded in the extreme. if you want, pm me, I'll hook you up w/ some sample code I've been doing for class. e-mail's in the profile, too.
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
bens1901
Registered User
Join Date: Sep 2002
Location: New York City
Status: Offline
Reply With Quote
Apr 2, 2003, 03:56 PM
 
If you are new to Java interfaces programming, then a book or online tutorial would be a great place to start. I would recommend a book, but I don't really remember where I got started with learning AWT. Actually, while studying for the Sun Programmer Cert. exam I learned about the various concepts.

If you already know some of the concepts of the Java interface (Containers, Layout Managers, Events, Listeners)...
What you may want to do is download and install Sun ONE ( mac:http://forte.sun.com/ffj/articles/macOSX.html, and they have it for Windows too). The Community Edition is free. It's a nice IDE for building Java programs. You can construct a simple interface using AWT components and Swing components, then look at the code and see what it's doing. I'd suggest keeping a browser open on Sun's classes page so you could quickly look up the methods and ideas of a class. Notice that Sun ONE will only let you edit non-blue-highlighted code while in the ONE editor. You can modify the code in another program (SimpleText, vi, emacs, etc.), but then the ONE editor may not like it anymore. Overall, Sun ONE is a great way to create a practice interface and then view the source code for it.

hope this helps.

-Ben
     
bousozoku
Forum Regular
Join Date: May 2001
Location: Oviedo, Floriduh USA
Status: Offline
Reply With Quote
Apr 2, 2003, 11:11 PM
 
Besides the Sun tutorial, I use Core Java Foundation Classes (ISBN 0-13-080301-4) as a guide.

There are actually very few books that are more than minimal showcases for a single GUI widget in each subsection.

Find real source code to learn how to do it. It's too labour-intensive otherwise.

I'm still working on my folding@home progress app, which is done with Swing, and it's quite a lot of prodding and poking to get exactly what I want.
folding@home is good for you.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:58 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,