|
November 9, 2004
This is a moderated forum. MDR-EdO: Welcome to today's Java Live chat on what's new in Swing. J2SE 5.0 adds a number of new JFC/Swing features such as a skinnable look and feel (Synth) and printing support for Scott Violet: Welcome all! Swing has a number of exciting new features for 5.0. The big ticket item is no longer do you have to do KevinM: What about any improvements in Threading? Scott Violet: For 5.0 we did not do any threading changes. For 6.0 there are a number of projects underway, including the ability to trigger events on the event dispatch thread to be processed. We also really, REALLY want to get Luigui: Can you point me to a tutorial or article that has examples of using the new printing support for Shannon Hickey: At the moment we don't have any articles written on the new Shannon Hickey: ...I'll try to get something on JavaDesktop.org or The Swing Connnection. joshy: What factors drove the feature set for 5.0? What sort of complaints did you get from users? Why kind of developers are using Swing that are asking for these features and how do they give you feedback? I guess I'm asking what drives Swing development? Scott Violet: I'll answer this question in terms of 6.0, which is what we're all doing. For 6.0 we met with a number of known customers, both big and small. For example, we met with SAS and SAP, but we also met with smaller companies like Quantrix. So, our features for 6.0 and 7.0 will be driven from these meetings, feedback from the community (ala JDC) as well as some of the more vocal members. And of course we (engineering) have a big say as well. ssirovy: Will Scott Violet: It is certainly on the table! In the mean time take a look at JDNC. bskaarup: I am trying to figure out if Shannon Hickey: While the default Header and Footer support in the Marco: Could you give us some insights on the Swing topics for the next release? Scott Violet: Sure, but remember that none of this is set in stone and can certainly change going forward: snowbug: Talking about swing threading, I have been using a open source API called foxtrot, which is extremely easy to use and integrated with swing nicely. Are you aware of that? Scott Violet: Definitely, as well as Spin. My main concern with these approaches is that they require the toolkit to be reentrant (as do modal dialogs) and there are a handful of places where this isn't true. That said, AWT is looking at adding the ability to pump events at any time, which would greatly simplify what Foxtrot does. herpgps: When will you have an example of a synth look and feel? Shannon Hickey: This is definitely a priority for us, and something is in the works, hopefully to be released on JavaDesktop.org Lordy: Hello. I have a question for the next big release: get Scott Violet: We are actively investigating ways of improving Swing's HTML support. At a minimum we want to add text printing for 6.0. KevinM: Do you have any pointers for Drag and Drop and Shannon Hickey: With Swing, it is preferred to use the built-in drag support rather than rolling your own. The best reference for this is in the Java Tutorial. Your observation of DnD swallowing mouse events is correct - mouse events are not delivered during drag and drop. snowbug: I guess, I should say, my personal experience is that the small foxtrot api is easier to use than the swingworker, please consider that when improving the swing threading. Scott Violet: A number of people have said as much, so, yes, we are considering better enabling what Foxtrot needs. tonyj321: Any news on a fix for the bug which makes some letters (for example "C") look ugly on windows? Scott Violet: Yes and no. On the Swing side we're hoping to start using Tahoma as the default font, which would indirectly fix that. This fix will hopefully be in an update release (update 2). Beyond that the 2D team is looking at the rasterizer to see where the problem is with 'C' and other characters. joshy: Do you plan to officially pull any of the JDIC and JDNC components into the JRE proper? Scott Violet: Most definitely. Guest: Do you have a SwingSet version using Synth? Shannon Hickey: No, not at the moment, since we don't have a default synth skin. Once we do, it wouldn't be long before it's added to SwingSet2. comeon: Since we have two of the core Swing team members here, I would really like to hear what you folks think is(are) the best enhancements or new features gone into the five dot oh release. What is to be most excited about? Scott Violet: For Swing, may favorite is joshy: A mention of improved layout support. Will this involve new layout managers? Or a non-code based form of layout? Scott Violet: Possibly. Initially this will consist of: improvements to Guest: A bit off topic: Is there a tutorial on Swing development for database forms? I am new to Swing and the API is great...but I am developing applications for databases mainly and I have not yet found a good method to use for database access. Shannon Hickey: We currently don't have a tutorial aimed at this question. However, the JDNC project is interested in this and is actively working on it. jim: Microsoft has a notion of DLUs (Dialog Units), for dealing with font/component spacing; and they discourage the use of pixel placement. This becomes an issue when attempting to provide a cross-platform look-and-feel, which truly looks the same (position wise). Does Swing support, or plan to support, this type of "positioning" mechanism? Scott Violet: Yes and no. We're looking at the general problem of scaling UIs which would indirectly address this. We may also need something similar to dialog units, but we're not sure here yet. It's all still up in the air. datbates: My coworker went to JavaOne and went to a class where they emphasized that network/ database calls should not be made on the AWT queue. While this is obvious, it is not an easy thing to manage. It's almost like I would like to put the thread into a repaint only mode while I make my call so that it will not look dead, but I don't really want to manage setting the window disabled and hopefully reenabling it when the call is complete through another thread. Is there an easy way to do it? Shannon Hickey: There are two approaches that I can think of. 1) Throw up a modal dialog, or 2) Show a glass pane and set the cursor to busy. By the way, you can do all kinds of neat things with glasspanes - for example, showing a translucent color over the GUI ;) Marco: Will there be an enhanced desktop integration of Swing covered in the next Java release, such as the tray icons that have now been implemented by the JDIC project? Scott Violet: I believe that is being considered. I'm not positive here because it's being driven by the AWT team. joshy: Does this mean that there will be an overhaul to anti-aliased text support? Scott Violet: I lost the thread that you're referring to. But I will say that the 2D is looking at how to enable sub pixel rendering (Microsoft calls their implementation ClearCase) and of course Swing would then start using that when appropriate. dags: What about data aware swing components? Scott Violet: That topic is being worked on by JDNC. Again, the long term goal is to pull parts of JDNC back into core. jacky: Is it possible to port the printing support for Shannon Hickey: It's certainly possible to make something like the Lordy: I think better DnD support in Shannon Hickey: Enhancing Swing's DnD support is something we feel a strong need for and are looking at currently. Timmy: When will Swing reach complete native OS Look and Feel affinity? For example, drop shadows and anti-aliased text (clear-type) on Windows XP? Scott Violet: We are very close. In my opinion, clear type text is really the only issue the end user might notice, and that is actively being worked on. The drop shadow issue is another one we're looking at, but should be a lot simpler than cleartype. Guest: Will you be giving the Synth LookAndFeel useable defaults? Right now if you set that as the LAF stuff just disappears. It would be a lot simpler to customize a set of proper defaults. Shannon Hickey: Once we come up with a default Synth skin, it would be a logical step for us to make it the default so that Synth is ready out of the box. Marco: Do you have any information on the performance of Swing for version 5 in regards to memory footprint and startup time? Scott Violet: I don't have definitive numbers in front of me, but I believe the class data sharing work resulted in startup improvements of around 15% for many apps. The heap changes I referred to were centered around reducing the number of classes swing loads (by coalescing listeners and Actions) as well as reorganizing certain fields that are not commonly used. kschneid: Any plans for non-rectangular top-level windows? I suppose that's more of an AWT thing... Shannon Hickey: Yes, it is actually more of an AWT thing - but I do know they're investigating it. TedYoung: There are some Swing bugs that have been around for almost 4 years (for example, 4406598) -- what's Sun's plan for fixing these really old (but still existing) bugs? Scott Violet: Yes, as with any toolkit of this vintage there are old bugs. One of the things we look at in fixing bugs is JDC votes. So, please vote for bugs that are important to you. JRS: Are there plans to add new components such as Drawer panels (i.e. OS X) into swing? Scott Violet: There are definitely plans for new components: dags: jgoodies form layout supports this DLU method. Scott Violet: Definitely. JGoodies has some very cool layout support that a number of people use. comeon: As I understand it, one of the new features of Java 5.0 is the OpenGL acceleration of Java2D. How will this affect Swing performance when enabled by default? Scott Violet: We are looking at making Swing use true double buffering, this should show some very nice improvements in performance when coupled with OpenGL. (Sorry, I don't have concrete numbers for this either.) comeon: OK this is off topic but I'm dying to hear if you folks have had the chance to test the new GUI builder for Netbeans 4.1. I have not tested it but according to Tim B - this is going to be huge - please any info for the needed. Scott Violet: Default. We're working with the NB guys on this, and indeed it's currently looking very cool! You would no longer have to know how to use a LayoutManager to use Swing/AWT! MDR-EdO: Our next chat (on November 16) is on NetBeans 4.1. Pramod: Any possibility of a Graph Editing Component in Swing? A lot of applications could use the ability of editing graphs. Shannon Hickey: Swing provides the basis for building such components, but they are at a higher level than what we typically provide. I understand there are some open source components available though. JRS: Swing has a really ugly grey background that comes up when garbage collection occurs during repaints of the contents of a frame. (for example, when closing a window on top of the frame.) Can it not be done just like when you resize the frame, a snapshot of the current background image is taken and painted temporarily until the back buffer is ready to be copied? This would give much better response to the user. Scott Violet: This is what I referred to as the 'gray rect' problem. There are two things that together give this experience: one, we do erase the background on the native thread when the event is received, and two we don't have true double buffering. We're looking at disabling the native erase, and turning on true double buffering. Together this would mean exposes of Java windows will be immediate! kees: Will you let the open source community participate in developing/fixing swing? Scott Violet: Yes. Take a look at the JRL that was just recently announced. Hopefully this will make it easier for you guys to get the latest code and give us patches against it. Pramod: I have been trying to use the Synth LAF and found a lot of useability issues such as it is very difficult to change borders. Popup menu borders are not customizable etc. What is a good place to understand/get answers for my questions about Synth? Shannon Hickey: Being still quite new and having no default skin, we haven't received a lot of feedback yet on Synth. So questions like this are welcomed! Please seek help in the Swing forum on JavaDesktop.org (we read and respond to the forum). Also, please file bugs when you find them. Marco: I have problems with displaying large texts in a Scott Violet: This would make for an interesting article. While I don't have anything to point you at, what I will say is that you can provide your own representation of the data and this could be backed by a memory mapped file. Take a look at Marco: Will the "gray rect" be fixed in a minor update version? Or is there any current workaround for it? Scott Violet: We're still evaluating that. Current feel is that it's too risky (big code change with possible incompatibilities). There are system properties for disabling the native erase, email the swing forum and I'll dig it up for you. herpgps: What is the time frame for this default Synth skin? Shannon Hickey: :) As soon as we can. Because we know it's important. Marco: Do you have any details on how to best look for memory leaks? I had a memory leak a while ago and found out that a listener still had a reference to a window object. Scott Violet: There are a number of tools that automate this for you. I've used OptimizeIt in the past for this and it's very helpful. To do it, run your application in the tool, and then search for references and follow the references back to the root objects. Martin Bromley: To continue the gray background thread, I've found that setting Scott Violet: That's the property! There is another property that changes this for resizing windows which I don't have in front of me. I will say that we are investigating a way to get the defaults we want you to use out of the box. This would likely be done as part of the Application class I previously referred to. joshy: Are there any plans for mini-components? Meaning, smaller versions of standard components for use in toolbars/pallets? This has become a standard set of components in OSX. Shannon Hickey: Honestly, this isn't something currently on the table. If there's a lot of support for it, it would be something we'd consider. jim: When a Swing application is minimized and Windows begins to swap memory, restoring the Swing application displays a completely gray area until the memory has finished the swap. Are there any plans to enforce a "lock" on the memory, so that it does not get swapped? Scott Violet: There is a flag that changes this policy. If you post to the swing forum we'll dig it up for you. JRS: It seems that multi display support works sporadically and is not very reliable. Tooltips show up on the other monitor sometimes, high CPU usage when you have two frames on each side of the monitor. These days having multi monitors is more common. Has this been resolved since 1.4.2. Haven't had the chance to test it under 1.5 yet. Are there plans to improve this? Scott Violet: A number of us have multiple monitors, so, we definitely get that it's important. I'm not aware of the specific bug fixes though (with the exception of one in m0rph: Some Swing components behave differently when used within a standalone application (run with the JVM) and within an Applet? Why is this and will it be fixed? Scott Violet: I'm aware of two things here: access to the clipboard, and file chooser. Beyond that things should behave exactly the same. Please file bug(s) if that isn't the case. kwalrath: Way back to the question about graph components...You can find a (incomplete) list of 3rd party components here. You can also find product announcements for J2SE-based, GUI-related products (including components) at the JavaDesktop Product Announcements forums. You can get there by clicking the "Product Announcements" link on javadesktop.org. codeshark84: Is there any relief in sight for having to remove listeners explicitly when a component is being disposed? Scott Violet: Yep, at least at the model level. There is an RFE so that the listener the Howlerzz: On the multi display thread, we have even had popup menus show up on the wrong screen. Scott Violet: I definitely remember that behavior too. I want to say it's fixed in 5.0, but I'm not positive there. gonzo: OK ... silly question ... is it possible to make Shannon Hickey: Gonzo, did you mean the "animation" part of the scrolling or just the fact that you can see the newly appended text? gonzo: yup ... it is quite slick. i'm looking for anything to "soften" up the ui experience, make it less binary? Shannon Hickey: Swing's text components, unfortunately, don't support anything like this out of the box. You could probably write something - but without thinking more about it I can't say exactly what you'd write. ;) m0rph: Will Swing provide animations for tab selects, button clicks, etc.? Scott Violet: At this time we don't see doing it for the Java look and feel. If one of the platform look and feels does (say Aero), than we will try and accommodate that behavior. Scott Violet: So, we've talked about a number of things we're planning for 6.0 and some for 7.0. Is there anything obvious you think we're missing? joshy: I know it's a long shot, but are there any plans for non-rectangular windows? The three major platforms support it natively now so it might not be too hard. Scott Violet: I know it's something we wanted to do for 5.0, but weren't able to finish up. It's being debated for 6.0. Much of the concern centers around non-rectangular windows would cause us to go down slower rendering code paths :( Marco: It's important for us is memory footprints and performance. I currently have problems displaying a 500KB text file in a Scott Violet: Ok, we'll consider how we can either improve that or write an article on the best way to go about it. ssirovy: We've seen marked improvement in our multiple monitor environment. Bug 5085626 was fixed in 1.4.2_06, not sure of 5.0... Scott Violet: Glad to hear it! Pramod: I was trying to do what NetBeans has for its tabs (a small cross to close the tab) but eventually found that was because they wrote their own tabbed pane, do you think you can allow customization of the Shannon Hickey: This is actually something we're currently considering - that is, allowing tabs to be customized with components. jacky: Is there anything in Swing that we can make use of to help automate GUI testing? Scott Violet: The closest thing is the codeshark84: I would love to see customizable tab components. It would be nice to do something like Apple's Safari web browser which has a close button on each tab. Scott Violet: Definitely. That's one of the ones I forgot to mention. We're consider enabling the tabs to be components, that way you could use whatever component you wanted in there. This would enable animations on the tabs, close buttons, you name it! Pramod: I have used the jemmy toolkit that the NetBeans guys use and love it for autotesting Swing. Do you think you would consider adopting something along those lines? Scott Violet: I'll plug jemmy too, a number of people use it and love it. About rolling it back into Swing, it likely makes more sense to remain outside of core. Luigui: Is there anything you can do mimic platform L&F more closely? Shannon Hickey: Yes! (WE think so anyway) - we're currently investigating calling into the native platform to make rendering match the platform exactly. We hope this will help a) for tracking the Longhorn look and b) for supporting more GTK engines. EdO: Well, we've quickly come to the end of our session. I'd like to thank everyone who participated today. I thought we had a nice range of questions. And of course, I'd especially like to thank our guests Scott and Shannon for their answers. Scott Violet: Thanks for the great questions everyone! Sorry for those we weren't able to address in time. If you still have unanswered questions please go to the Swing forum on java.net and we'll do our best to answer them. Shannon Hickey: Thanks everyone for your time and some great questions! MDR-EdO: Last moderator (me) signing off. The forum is now unmoderated. | ||||
|
| ||||||||||||