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
Print Button
 
Office Hours Transcripts Index

Office Hours:
Swing Short Course
November 12, 1997

Moderator (MDR): SPK-jaz

SPK-jaz: Hello, and welcome to the first set of office hours for Part I of the online Swing course. My name is John Zukowski, with MageLang Institute (http://www.magelang.com), and I'll be available for the next hour to answer any questions you may have about Part I of the Short Course, or Swing in general.

bouzi: About MenuShortcuts, I am using JMenuItem and setting setKeyAccelerator. This works when displaying the shortcut (underlined), but no Ctrl or Alt sequence actually gets to it.

SPK-jaz: The key accelerator is not the same as the 1.1 MenuShortcut. A key accelerator highlights a particular letter of the menu item, to signify that the user can select it with the appropriate shortcut key and the accelerator key. I'm trying to create an example to demonstrate the shortcut vs. accelerator thing for you.

bouzi: So am I not supposed to use key accelerators for menus, or should I use them differently? Or is it possible to use normal MenuShortcuts with JMenuItems?

SPK-jaz: You can use key accelerators with menus, but they underline the accelerator key, vs. show something like CTRL-V. For instance, ALT-E, ALT-P is paste, vs. just CTRL-V in most Windows apps. It looks like the way the Swing team set up the MenuItem UI, the key accelerator and the shortcut are equivalent. I'll have to send them a message about this as that isn't the way it should be.

So, paragshah, have you tried out the online Swing course yet?

paragshah: I haven't tried the online Swing course yet. Actually I'm working on a tree interface that is still not a part of the course.

SPK-jaz: JTree is covered in Part II of the class. Do you have a particular question about JTree?

paragshah: I have made an applet that uses the JTree class. The applet shows erratic behaviour with different browsers.

SPK-jaz: Applet support isn't really there yet in Swing. Stick with applications. It's gotten better...

paragshah: Do you have any idea when there will be applet support? Because I am developing something that needs browser support. I would like to use JFC for that, if the applets become stable in some time.

SPK-jaz: When it is released, there will be applet support for sure. Before then, I don't know when. I would at least hope when it hits beta it will be there. Because untrusted applets can't touch the system event queue, the JComponent internal event handling needs to be done a little differently. Apparently, the Swing team doesn't have all the kinks out of this yet.

paragshah: Another problem I faced with Swing was when I tried to make one of my components, which extended from JPanel into a bean. I understand that JPanel is by itself a bean. But if I extend anything from JPanel and try to drop it into the beanbox it gives exceptions while loading it.

SPK-jaz: What kind of exceptions?

paragshah: The classloader gives an exception. Some kind of securiry exception while loading resources. SecurityException: No access through getResource() to .class in 1.1

SPK-jaz: I wasn't aware of this problem. However, if you create a test case and send it off to the Swing team, I'm sure they would take a look at it. Or just submit a bug report. Creating a simple testcase helps in getting a response, otherwise if the tester can't recreate the problem, they'll think it's a user error.

mzimmerm: John, let me say first that the Swing Short Course is great! I have been using code from it a lot to help me. One thing I could not do was to access some links, I get following message:

This page is restricted to authorized JDC members. If you are supposed to have access to this area, please send us an email. If you've just been granted access, but got this message before, try pressing the Reload or Refresh button on your browser.

As well, I tried to save pizza.jar on my PC (Win95) and run:

jar tvf pizza.jar
And I get an exception: Oversubscribed literal/length tree. I do not need these myself, but I thought I should mention it.

SPK-jaz: Thanks for the comment. I'll check that the pizza.jar file is valid. Did you shift-click to save it, or is this in the `whole' course download?

mzimmerm: Yes, I right-mouse clicked to save it. I did not try other JARs from the course. After you remove the element, do you validate or anything?

Okay then...

SPK-jaz: As it seems we're out of time, and there are no more questions, I want to thank everyone for coming. Hopefully, your question was answered. See you next week, or at your friendly neighborhood Code Clinic. This is John Zukowski signing off....

coffeecup



Print Button
[ This page was updated: 21-Sep-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary | Feedback | 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.