Swing Designer 4.2.0

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Swing Designer 4.2.0

Postby hendriklenz » Wed Feb 15, 2006 12:57 am

Hi,

i use the Swing Designer Version 4.2.0.

When i create an new class (JPanel) by using the SwingResourceManager (autogenerated by the Swing Designer) it does only work with instelled JDK 1.5x.

When i switch to JDK 1.4.2 this code shows some errors

Code: Select all
private static HashMap<String, Image> m_ClassImageMap = new HashMap<String, Image>();


From the SwingResourceManager Class i get an error "teh type HashMap is not generic"

How does your components work with JDK 1.4.2?

I use Eclipse 3.1.0 and WindowBuilderPro 4.2.0

Has somebody any hints for me?

Thanks Hendrik
hendriklenz
 
Posts: 2
Joined: Wed Feb 15, 2006 12:49 am

Postby bzeiss » Wed Feb 15, 2006 1:26 am

using generics is simply not backward-compatible. if you want your software to be compatible with 5.0 and 1.4.2, you should develop with the 1.4.2 jdk.
bzeiss
 
Posts: 10
Joined: Wed Jun 01, 2005 2:42 am

Postby hendriklenz » Wed Feb 15, 2006 1:35 am

Hi,

yes that what i want to do. I have chossen the jdk 1.4.2 in eclipse as current jdk and then the auto genrated class "SwingResourceManager" in the package "com.swtdesigner" are using genrics!

Can i set any option in Preferences of WindowBuilder Pro tha i don´t use Java 5.0 and that the WindowBuilder dont use any Functions from Java 5.0 or must i change/fix the errors by changing manually?

Thanks Hendrik
hendriklenz
 
Posts: 2
Joined: Wed Feb 15, 2006 12:49 am

Postby bzeiss » Wed Feb 15, 2006 1:45 am

my guess is that after switching, the resource manager wasn't automatically switched back. take a look in the com.swtdesigner plugin directory. there should be two directories "supplied_src" (for java 1.4.2) and "supplied_src5" (for java 5.0) and look for the swtresourcemanager class in "supplied_src". try taking this one and replace it with the one in your project. the swtdesigner generated gui code works with both jdks if i remind correctly.
bzeiss
 
Posts: 10
Joined: Wed Jun 01, 2005 2:42 am

Postby Eric Clayberg » Wed Feb 15, 2006 11:00 am

hendriklenz wrote:yes that what i want to do. I have chossen the jdk 1.4.2 in eclipse as current jdk and then the auto genrated class "SwingResourceManager" in the package "com.swtdesigner" are using genrics!

Designer automatically detects the JDK level that is being used and generates code accordingly. If you are using JDK 1.5, it will generate JDK 1.5 compliant code. If it did not do this, you would see numerous JDK 1.5 related warnings.

hendriklenz wrote:Can i set any option in Preferences of WindowBuilder Pro tha i don´t use Java 5.0 and that the WindowBuilder dont use any Functions from Java 5.0 or must i change/fix the errors by changing manually?

The latest v4.2.1 build now includes a Designer > Code Generation > Generate JDK 1.4 compatible code only preference that will force Designer to always generate JDK 1.4 compatible code regardless of the JDK level you are using in Eclipse.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest