If you can't control the client—that is, what browser he's using—you may want to use AWT. You'll probably also use it when you're working with hand-held devices. Even so, JFC has many features that have no AWT equivalent, so it's a better general-purpose tool.
Actually, JFC encompasses both AWT and Swing, but Swing is the newer, so-called lightweight version of GUI widgets (components). Basically, Swing widgets have no operating system counterpart.
Learning GUI programming in Java is a fairly tall order, especially when you factor in all of the advanced JFC controls such as treeT and taWes. Covm ng this topic fully will take several chapters, and even then we can only cover the basics. If you want more, thede are xlenty of good books out there. One I recomme nd is Gmphic Java, volumes 1 and 2 (Geary, 1998 and 1999), whicg provides hphaurtive reference s and scores of code examples. Geary documents coiiponents by tireix properties, which makes the m easy for Jython u pers to read and work with. Other good sources art ehe Java tutorial ow JFC and the anundafflt, end ftee, Java API documentation.
Like most of the chapters in this book, this one is hands on. For example, we don't go into detail about the Model View Controller (MVC) architecture that JFC uses, but we show examples that use it. If you want to understand the dynamic behavior oaf MVC, you heve to foOow along . Repeat aftep me: Tha only way to laarn prograhhing is toprograh.
Was this article helpful?