Main JAR Packager Native JFC Technical Support What's New dbDE


Using Swing with Visual Cafe 2.5

1. How does Visual Cafe support Swing?
2. Deploying your Applet with Swing components.
3. Known Issues and Workarounds.
4. How to install a new version of Swing.
5. Future support for Swing.
6. Swing resources.

1. How does Visual Cafe support Swing?
-----------------------------------
We have done several things to make Swing work within Visual Cafe 2.5 that are not in previous releases of VCafe.

* The code generation for components dropped onto a bean that implements RootPaneContainer such as JFrame and JApplet will produce getContentPane().add(xxx)

* You can create a JMenu Hierarchy by drag and drop. For example, drag a JMenuBar onto a JFrame, then a JMenu onto the JMenuBar, and finally a JMenuItem on the JMenu. If you want to use the menu editor, you can use the standard JDK Menu components and add them to a JFrame.

* Swing is part of the default parse information. This means you can view Swing in the Class Browser, Hiearchy Editor, Class Wizard, etc.

* The Jar Utility can pull in the Plugable Look and Feels that you specify.


* We made property editors for properties that can be set with the Swing constants.


2. Deploying your Applet with Swing components
-------------------------------------------------------
There are a couple ways to do this:

1. Have the target audience use the Project Java Activator (see Resources below). This runs applets as a plug-in in Communicator 3.0+,and Explorer 3.0+. The nice thing about this is that swingall.jar is already on the users machine. You just provide the classes needed that aren't in swing on the server.

2. Include an ARCHIVE tag with two jars. One of them is "swingall.jar", and the other one is a jar with all the non-swing classes. Note that Communicator doesn't support the ARCHIVE tag, and you'll have leave your classes unjarred on the server. This can lead to a long download time as you can imagine.

3. The target audience can have a copy of swingall.jar on their machine and in their classpath.

When you are ready to deploy your applet, you can use the JAR Utility to create a JAR with all the necessary swing classes.


3. Known Issues and Workarounds
----------------------------
* Code is not generated for adding components to JTabbedPane, JSplitPane, JTree, etc. For example, when you drop a JPanel on a JTabbedPane, code gen for addTab() won't be generated. You add this code after the //{{INIT_CONTROLS block.

* When using a JPanel on an Applet (not JApplet) events are not propagated in the AppletViewer or Communicator.

* JSlider doesn't initially paint correctly. If you manually setValue() on it after the //{{INIT_CONTROL block it will paint okay.

* The Win32 dll's for swing are not included.

* When dropping a JComboBox on the Form Designer, you will get an error message. All this means is that the index needs to be set.

* The JDialog icon is not included.

* There are cases where compressing your jar will fail with Swing components. Jar your project uncompressed and it should complete okay.


4. How to install a new version of Swing
-------------------------------------
When a new version of Swing comes out, follow these steps to integrate it into vcafe.

1. Exit out of VCafe if you are running it.

2. Replace the /vcafe/Jfc directory with the new version of Swing.

3. Unzip the source(src.zip) into /vcafe/Jfc retaining the directory structure.

4. In /vcafe/bin delete "jdk.vep" and "jdk.ve2"

5. Restart VCafe.

6. When prompted to reparse the JDK, select Yes. This will take a few minutes.

7. After parsing is finished, start a new JFC Applet project, and open the Class Browser. You should be able to see the Swing packages and methods.


5. Future support for Swing
------------------------
We are currently working on adding additional support for Swing within Visual Cafe. We also welcome your suggestions which you can reach us on the Visual Cafe newsgroups. Information can be found at
the end of this readme.


6. Swing resources
---------------
Project Java Activator: Visit http://developer.javasoft.com They tell you how to download it and to put the correct tags in your html file to use it.

Swing: Check out http://java.sun.com/products/jfc/swingdoc-current/index.html for all the information about Swing Sun has to offer.

Visual Cafe Newsgroups: We have several groups under symantec.support.devtools.windows.vcafe4java


See you on the newsgroups!

Visual Cafe Development Team