Top
Past Meeting Archive Los Angeles ACM home page National ACM home page Click here for More Activities this month
Check out the Southern California Tech Calendar

Joint Meeting of the
Los Angeles Chapters of ACM,
SIGPLAN,
and IEEE Computer Society

Wednesday, May 1, 2002

Developing Complex User Interface Applications in Java

Dr. Ray Toal,
Loyola Marymount University

The Java Core API offers developers a rich set of components (informally known as the Swing set, or simply "Swing") for developing graphical user inter-faces. Swing consists of the usual textfields, textareas, comboboxes, lists and buttons, and other useful com-ponents such as spinners, progress dialogs, and styled text panes. And these components are not platform dependent; they are usable on any machine and any operating system running the Java Virtual Machine.

In practice, the requirements that the Java Virtual Machine be present, and the sheer size of the Swing component library, means that complex applications using Swing can be quite memory intensive and run poorly on even average machines. Worse, the architectural framework on which Swing is built (a variant of the Model-View-Controller paradigm) all but encourages programmers to write code with memory leaks.
This talk will examine the structure of Swing-based applications and show how developers can avoid many of the pitfalls which cause memory leaks and other performance problems. Other practical issues required such as internationalization and support for undo will be briefly covered.

Dr. Toal received his bachelors degree from LMU in 1985 and his Ph.D. from UCLA in 1993. He has been teaching a variety of courses continuously at LMU since 1986. His current research interests are in internetworking, compiler construction, computer graphics and software verification. He has consulted at Citysearch since 1996 where he co-architected the company's first online city guide and developed a number of in house software tools for graphic designers and editorial content developers.
 

"Developing Complex User Interface Applications in Java"
The presentation by Professor Ray Toal of Loyola Marymount University was at a joint meeting of the Los Angeles Chapters of ACM, the IEEE Computer Society and SIGPLAN on Wednesday, May 1. 

Professor Toal described this talk as being about Java's approach to GUIs (graphical user interfaces), technical aspects of the Swing GUI Framework, difficulties with Java GUIs and practical strategies to develop effective GUI Applications in Java. The talk is not about getting started programming in Java, three-dimensional graphics, comprehensive details of Swing or how to design and lay out UIs. 

Java is a general-purpose language that was originally conceived for embedded network-aware devices. Its initial popularity was because of the Java applets. Java is now popular in enterprise applications, mostly on the server side. Java encourages GUI programming and it has a large set of "standard" APIs. Java experience does not always follow textbook advice. In practice there are problems using Java as a front-end tool. It is slow and it hogs memory. 

Java GUI applications will have components, layout managers, events and listeners that respond to events. The AWT is the library containing layout management, event and listener management as well as many other useful details. Swing is the library with the components and a small number of extra events and layout tools that Sun did not put into the AWT. Professor Toal warned that the components in the AWT should not be used. 

Next he ran a graphic demo with some bouncing balls. He said some Java "gurus" suggest that you use anonymous inner classes for listeners, but then you cannot remove them from listener lists. The threads stay in memory even after they stop running. He described a complex user interface application as long running (not a throwaway), with components mapped to objects in a database, multiple screens, and file and editing capabilities. It is something that cannot be replaced with HTML forms without a massive user productivity loss. Memory leak problems are much worse with complex UIs as one remaining thread could result in a "loiterer" holding on to megabytes of useless data. Loiterers are objects that are reachable but you don't want or need any more. The Java garbage collector takes care of the unreachable objects that are the real memory leaks of C. Even if you recognize loiterers you might not be able to do anything since the reference may be a private field of a class for which you do not have the source code. Java memory leaks are less frequent than those in C or C++ but are usually more severe. 
Professor Toal said he didn't have anything to say about internationalization of Java other than that you need it and it is a good reason for not designing UIs in absolute pixel coordinates. He recommended using a graphical layout tool and spending time to learn the details of GridBagLayout. Design so the layouts look good as the container size expands and shrinks, and test for all different languages. 

He said if you decide to write a complex UI-based application in Java it means you are starting with the adverse memory requirements of JVM and the Swing Libraries, so you must be careful not to make it worse. If you spend a few hundred dollars on a good memory-profiling tool it will save you thousands over the life of the product. For further study he recommended: “How Do You Plug Java Memory Leaks” by Ethan Henry and Ed Lycklama. 

For more information you can go to http://technocage.com/~ray. His website includes all of the charts he presented at the LA ACM meeting and more details. You can get the information Ray presented at the meeting, but if you were not there you missed his insightful remarks. 

This was the tenth meeting of the LA Chapter year.

Mike Walsh, LA ACM Secretary 


The Los Angeles Chapter normally meets the first Wednesday of each month at the Ramada Hotel, 6333 Bristol Parkway, Culver City. The program begins at 8 PM.   From the San Diego Freeway (405) take the Sepulveda/Centinela exit southbound or the Slauson/Sepulveda exit northbound.

6:30 p.m.  Cocktails/Social

7:00 p.m. Dinner

The menu choices are listed in the table above.
Avoid a $3 surcharge!!
Make your reservations early.

8:00 p.m.  Presentation

 

To make a reservation, call or e-mail John Radbill, (818) 353-8077, and indicate your choice of entree, by Sunday before the dinner meeting.

There is no charge or reservation required to attend the presentation at 8:00 p.m.. Parking is FREE!

For membership information, contact Mike Walsh, (818)785-5056 or follow this link.


Other Affiliated groups

SIGAda   SIGCHI SIGGRAPH  SIGPLAN

****************
LA SIGAda

Return to "More"

****************

LA  SIGGRAPH

Please visit our website for meeting dates, and news of upcoming events.

For further details contact the SIGPHONE at (310) 288-1148 or at Los_Angeles_Chapter@siggraph.org, or www.siggraph.org/chapters/los_angeles

Return to "More"

****************

Past Meeting Archive Los Angeles ACM home page National ACM home page Top

 Last revision: 2002 0603 [Webmonster]