Speaker Richard Ray (rich) and Michael Martak (Mike)
Moderator Edward Ort (MDR-edO)
This is a moderated forum.
MDR-edO: Welcome to Java Live! Today's session focuses on the Abstract Window Toolkit (AWT). Our guests are Richard Ray and Michael Martak, key engineers on Sun's AWT team. They'll answer your questions about AWT, especially what's new in AWT for JDKTM 1.3. So let's begin.
jgf: I'm interested in knowing of any performance enhancements in AWT for JDK 1.3. Could you outline these with numeric metrics?
Mike: jgf, while we can't specifically give performance metrics (we have a separate performance team that deals with that), we did make a number of performance enhancements in the JavaTM 2 SDK. In AWT specifically (in 1.3), we primarily improved the painting by coalescing paint events. Number of classes loaded for AWT apps has been kept down and bench marked, as well as memory footprint.
jgf: I recently wrote an OS message sniffer on a popular Windows orientated platform. I had to code this in C++ due to the 'underhandedness' of intercepting OS messages. Is this possible in AWT for JDK 1.3 (or is it in the pipelines)? Is it something we would want of the Java platform?
rich: Yes, you can look at each massage, but that is at the Java platform level and not at the OS level.
ro: I'm a little confused about the new print package. How does it relate to the unified printing API Java Specification Request (JSR)?
Mike: The unified printing API JSR is an attempt to resolve the various printing APIs and the confusion caused by them. While I haven't looked too much at the JSR (I'm not our resident printing expert) that's the general idea, from what I understand. The new print package adds more flexibility in printing through the new getPrinterJob()
method.
Martijn: When you pop up a FileDialog
in AWT there's still no support for file filters, at least, it doesn't work. Are there any plans to solve this? Also the possibility to add several filters isn't there like in JFileChooser
.
Mike: There is a bit of a complicated answer for this one. First, the "feature" of file filtering should never have been in the API in the first place, since Windows has never had the capability, so it confused a lot of people by having it in there. We went back and forth on various approaches to solving this problem. Ultimately, it was documented that it isn't supported on Windows, though on UNIX platforms it should work fine now.
Vijay: Does Sun Microsystems have plans to come up with new device driver for graphics card that can improve performance of AWT in future?
rich: We are making many enhancements related to graphics performance in the next release of the Java SDK. There will be support for hardware in graphics cards. New classes will allow hardware page flipping.
ro: Another question: We would like to transfer images using the Clipboard API, but there is currently no support. Also, we'd like to move rich text and tabular data. Will this be supported in 1.3.1 or 1.4?
Mike: We are currently working hard to resolve the data transfer (clipboard) API and the drag and drop API. I don't know specifically about images or rich text support in the immediate future, though I would suggest sending it as an RFE on the bug parade.
xhunterx: The ability to programmatically maximize Frames/JFrame via a new setState()
method had been a longtime RFE that was recently closed. The Bug Report cites a 'nonpublic release' in its closure message: are you aware if the status of that particular RFE?
rich: The next release of the Java SDK will include support for maximizing a Frame
.
jgf: The documentation mentions the possibility of creating Java CBT based applications using the java.awt.Robot
. Is this a method for listening on OS messages? I'm specifically asking this question because I'm actually in the process of writing such an application.
rich: Robot
does not support listening to OS messages
123: IE and Netscape don't seem to support Swing of Java JDK 1.3?
rich: Netscape 6.0 supports 1.3, or you can use the plug-in for IE. We are also supporting a new technology called JavaTM Web Start that allows applications to be launched from any browser.
chamann: What was the primary reason for adding the getListeners()
method to various UI classes?
Mike: Many methods such as this were added to support the IDEs.
ro: The Merlin release listed mentioned support for wheel mice. Does this mean that Swing components will automatically support wheel scrolling and wheel panning?
rich: Yes, the next release of the Java SDK has complete support for MouseWheels
in both Swing and AWT, and it picks up the default scrolling behavior. There is also a new MouseWheel
listener.
Brigitte: Could you please simply sum up the main points of what is new in AWT for JDK 1.3?
rich: There is a new Robot
class, Paint coalescing, printing API enhancements and AWT Native Interface. Robot
can be used to testing your AWT or Swing applications.
MDR-edO: For those of you not familiar with the new Robot
class, you might want to look at the JDC Tech Tip for July 11.
MDR-edO: Now's a good time to ask your questions. The queue is pretty small.
arkay: The Windows look and feel doesn't look right in a lot of cases: wrong fonts, colors, sizes, and so forth. Will AWT provide support to get as OS specific properties like window sizing, border sizes, icon sizes, and such? This could really improve the way Swing looks. It would also make it easier to write better components.
rich: Also the we may be adding PLAF top level windows. There will most likely be support for undecorated frames and dialogs allowing an application to decorate themselves.
chamann: Is there a new LayoutManager
being developed? If so, how will it differ from what's currently available?
Mike: It is my understanding that our usability team is developing a Java Look and Feel layout manager, which will be part of Swing in Merlin.
rich: In the next release of the Java JDK, the Windows PLAF is being greatly improved and will take on the native look depending if on Win NT or 98 or even ME.
Martijn: Another similar question like above. When one uses Menu objects, and for example add "File". One can set menu shortcuts on MenuItems
. However when one tries to set a shortcut for Menu (which is subclass of MenuItem
) and tries to set the ALT+F which is a standard shortcut, it doesn't work in Windows...
Mike: Sounds like a bug that should be sent to BugParade. We'll try to fix it as fast as we know about the details and have the resources.
mjg23: Question about performance between NT & Solaris: A lot of the 1.3 performance improvements in AWT and Swing seem to be MUCH FASTER on NT compared to Solaris. Will this be resolved before 1.3 goes into production for Solaris?
rich: Yes, the Solaris Java SDK 1.3 will have improved performance through the Java HotSpotTM technology.
chamann: What addition functionality, if any, do you plan to expose through the AWT for developers to use?
Mike: As mentioned before, we have support coming up for wheelie mice. Additionally, we have plans for full-screen support, display mode changes, and complex buffering (page-flipping), focus improvements, headless support, undecorated frames and dialogs, and probably more that I'm forgetting about.
arkay: Regarding PLAF top-level windows--that's awesome. Metal definitely doesn't look right the way things are now. Who will handle sizing/moving the window--the PLAF, or will the Window Manager still control it? The reason is we would like to control how a window sizes itself on the fly so we can 'snap' it to the correct size, like when you resize toolbars in Office applications.
rich: With top level windows that use a PLAF, it will use the PLAF to control moving and sizing and even focus. I believe that there are still more performance improvements to going to the Java SDK 1.3 for Solaris.
mjg23: My performance comparison mentioned previously was between NT 1.3 and Solaris 1.3 beta. Why wouldn't these perform the same? Does the beta use HotSpot?
MDR-edO: Ten minutes to go. If you have a question for Rich or Mike, please send it in now.
arkay: Curious about page flipping. Will hardware flipping only work in full screen mode, or will the regular Swing-type double-buffering to a window work faster as well? Right now our application performance is worse on 1.3 than in 1.1 primarily due to the graphics 2D performance being so poor. Especially on X.
Mike: That one is near and dear to my heart :) The answer is that Swing will try to do double-buffering in VRAM using the new VolatileImage API whenever possible. Hardware flipping will also be available, but on Windows it's tied to full screen mode. We're currently trying to work out the details of a capabilities API for finding out where and how something is being accelerated.
ddrake: Excuse me if this has already been asked. Will skins be part of the new AWT?
rich: Yes the SKINS PLAF will be part of Swing for the next release of the Java SDK.
chamann: Is it true that the entire 2D graphics architecture is being rewritten?
rich: It is true that much of the 2D has been rearchitected. Hardware acceleration on graphics boards will be used and many other performance enhancements.
chamann: How does the new architecture impact memory usage?
Mike: It should reduce the memory footprint (or at least, that's the goal).
arkay: Anyway just wanted to say--keep on doing what you did for 1.3! Really, this was the first release where things got appreciably better performance wise. Seem to be fewer bugs too.
rich: Thanks everyone for your participation. This was fun!!!
Mike: Me too! Sorry we couldn't get to everyone's question. If we didn't get to your question, please email java-awt@java.sun.com.
MDR-edO: Well our chat has quickly come to an end. I want to thank all the participants, and especially thank our guests Rich and Mike!
MDR-edO: Last moderator (me) signing off. The forum is now unmoderated.
For more information on AWT:
Fundamentals of AWT Short Course
Participate in the AWT Forums
Reader Feedback
Tell us what you think of this transcript.