★ wanayoo — archive 1999 http://developer.java.sun.com/developer/community/chat/JavaLive/1997/jl0610.htmlNouvelle recherche | Portail wanayoo
Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Chat

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
JavaLive Transcripts Index

Java Live
Advanced AWT Topics
June 10, 1997

Moderator (MDR): MDR-lisa

Guest Speaker (SPK): SPK-name

MDR-lisa: Hi, everyone! This is Lisa Stapleton, editorial director of the JDC, and I'm here with Georges Saab, our JavaSoft AWT expert. Feel free to start sending your questions now. The first release of the Swing/Java Foundation Classes (JFC) has just been shipped to a limited group of licensees and partners, so if you have questions about Swing or JFCs, Georges is the man to ask. So, Georges, what is the relationship between Swing and the Java Foundation Classes?

SPK-Georges: Well Lisa, I'm glad you asked ;-) Java Foundation Classes is an umbrella term for a group of new classes and services that started with JDK 1.1. The Delegation Event Model, for instance, was a large new chunk of funtionality that was included in 1.1, and is a part of the JFC. Swing is the set of components, written in 100% Java, which provide an alternative to the AWT component classes.

creme: I would like to know when Swing will be shipped to everyone?

SPK-Georges: Swing will be a part of the JFC released with JDK 1.2. However, we're trying to make sure that we get as much feedback as possible for the Swing APIs by doing developer releases. Depending on the scope of the feedback that we get from the early access reviewers, we plan to release to the general public through the JDC in the next month or so.

whitteng: I'm trying to work with drawImage. I'm trying to draw a complete image into an image buffer and I'd like to know what the drawImage returns and if drawImage will ever iterate if the source image it is drawing is complete.

SPK-Georges: drawImage returns true if the image was loaded and painted successfully and false otherwise. It won't `iterate' as such on its own. But I'm not the best person to ask about drawImage. I'd suggest that you send that question to java-awt@java.sun.com so that Jim Graham can get a shot at it.

Dumbrill: What parts are defined as being in the Swing set and what other parts are in the JFC, but not considered to be part of Swing?

SPK-Georges: Basically, Swing is the set of components, and the parts of the services that are 100% Java (like keyboardUI and retargettable actions). The parts of the JFC that are not in Swing are the things that require native code, such as drag and drop, custom cursors, and so on.

werpu: Will the JFC also include some sort of lightweight windows like the IFC had?

RipeauS: Will Swing replace lightweight components?

creme: What is the content of the Swing? What are the new components?

MDR-lisa: Georges is going to try to answer these related questions all together.

const: Will .PNG image format be supported in JDK 1.1.x or JDK 1.2? This question is a bit related to Java2d because currently supported image formats do not fully support alpha channel.

SPK-Georges: I guess you are referring to InteralFrames, which can be used for MDI (Multiple Document Interface) types of GUIs? They will be included in the complete component set, but aren't included in the EA release, which we shipped last Friday.

MDR-lisa: That's a good Java 2D question, const, and Georges isn't comfortable answering for them, but I will forward the question on to that group, if you send me email to lisast@eng.sun.com.

SPK-Georges: PNG is unlikely for 1.2, but I can't give you a definative answer -- the best thing to do is send mail to java2d-comments@java.sun.com so that someone in the Java 2D group can give you a more definate answer.

whitteng: Does this mean that Swing does not use "peers"? Also, when is Swing/JFC/1.2 likely to appear in Netscape and IE browsers so that we can plan development strategies?

SPK-Georges: Swing does not use peers, that is one of the great things about it... Also, since it is 100% Java, it can be downloaded and used seperately from the JDK. It currently runs on 1.1.2, which means that once it is released, it will be able to be used in any browser supporting JDK 1.1.2 or later.

irsan: Swing components sound really good, but what about their performance? Won't they be very slow compared to native components?

SPK-Georges: It turns out that one of the major performance bottlenecks is the constant calling back and forth between Java and native code. By doing all the drawing of components in Java, much of this is eliminated, so the performance is quite good.

Dumbrill: Any idea what the time frame will be from the early release of the Swing components to the early release of the native code parts of the JFC?

SPK-Georges: The native parts require a new JVM (to have the native code linked in), so they will be included in JDK 1.2.

werpu: Will there be changes in existing AWT classes (Dialog for example) in JDK 1.2 and maybe in JFC?

SPK-Georges: There will be changes to existing components in 1.2 to fix bugs that have been reported. Swing is currently `sed-compatible' with AWT, meaning that it should be possible to run a sed script over most code, which will allow it to run with Swing. For instance, Button is called JButton in Swing, and supports the same methods, and some new ones!

const: What does "MVC arch." mean in description of Swing? Will be there changes in usage scenarios comparing to current native conponents like TextArea.

SPK-Georges: The internal architecture of a Swing component is a modified version of Model-View-Controller, a popular method of breaking down GUI components. As a component user, you don't have to know anything about this. If you care, however, it is possible to get in under the hood and manipulate the models of components. This is also an important part of how we implemented the pluggable look and feel for Swing.

rickl: The layout manager model has one limitiation that I hoped would be improved. Right now, components can be asked minimumSize and preferredSize. What I would like to see added is a hint. This would be a dimension passed to the component, indicating the best space available. Right now, if a component is variable in height because of width (i.e. wrapped text), it's impossible to safely do this. Are there any plans along this line?

SPK-Georges: You can also supply a getMaximumSize. In Swing, we've added two layout managers, which I think people will really like. One is a Springs-n-struts type manager, and the other is a BoxLayout along the lines of TeX glue.

const: RichText component is mentioned on Swing WWW page. Will it be allowed to embed other components in rich text? Will it support full HTML and RTF or only subset of them?

SPK-Georges: You can embed other components in the RichText component. Both RTF and HTML will be supported in the final version (I can't swear to which version of HTML). In fact, the parser is fairly seperate so it should be pretty easy to modify the component to handle other document formats

JoeSam: I have a JDBC/ODBC inquiry application with multiple rows and a scrollbar. I would like to have standard pagedown/up functionality for the scrollbar. Is there a way to get keyboard input to the scrollbar without adding listeners to the > 50 components on my frame? Generally, under JDK 1.1, can keyboard and mouse events be captured and observed prior to the component with the focus?

SPK-Georges: InputEvents are handled a little bit differently from other events. You might try setting a listener on the Frame itself. If that doesn't work, a good pattern is to create one listener, cache it, and add it to your rows as they are created. This reduces the overhead of creating listeners since you only ever create one.

const: Will the contents of RichText be a separate entry like String in TextArea or can RichText be constructed only inside RichText component?

SPK-Georges: The data in a rich text component can be manipulated seperately from the component itself, if you so choose.

ehorvath: We're having problems loading images in Netscape vs. Explorer in our applets. Netscape won't load JPEG files, and the GIF files lose considerable resolution. (The JPEG files will load locally, but fall apart once they are loaded on the server. Explorer does not have this problem.) Will this problem be solved in JDK 1.2?

SPK-Georges: You should probably take that up with the browser companies themselves (they often rewrite code according to our APIs). If you have a problem with these things in Appletviewer, then the problem lies in our implementation, in which case, you should send mail to java2d-comments@java.sun.com

MDR-lisa: Thanks, everyone. It is time to signoff now. And thank you, Georges.


[ This page was updated: 12-Jan-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.