Choose Panel not finding all packages

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

Choose Panel not finding all packages

Postby briefcase » Sun Jul 26, 2009 7:51 pm

Hi, relatively new to SwingDesigner, so sorry if this is a stupid question. I tried to use the Choose Panel option to add a custom class I created that extends JPanel. The resulting dialog box only shows custom JPanel subclasses from one package in my project (I'm using eclipse), and the second panel also only shows that one package listed. How do I get Choose Panel to recognize the other packages in my project. For what it's worth, the package it is finding is the first package in my project list in Eclipse. Even if I add the panel directly in the code, when I go back to Design mode it shows up as an error. Thanks for any help.
briefcase
 
Posts: 5
Joined: Sun Jul 26, 2009 7:45 pm

Re: Choose Panel not finding all packages

Postby Eric Clayberg » Mon Jul 27, 2009 4:59 am

Sounds like you have a classpath or compilation problem. Choose Panel will only find classes that have been saved and compiled properly (and for which a corresponding .class file exists on disk).
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

Re: Choose Panel not finding all packages

Postby briefcase » Mon Jul 27, 2009 5:54 am

I do see the .class file for the custom panel. Also, if I move the class into the package where I see other custom panels being picked up by Choose Panel, it still doesn't show. So, I guess it's something about the class rather than the path. The class compiles and works fine. It's a pretty simple class that extends JPanel. Is there anything else about a class that determines whether Swing Designer recognizes it as a panel? Thanks for the help!
briefcase
 
Posts: 5
Joined: Sun Jul 26, 2009 7:45 pm

Re: Choose Panel not finding all packages

Postby briefcase » Mon Jul 27, 2009 6:00 am

I think I may have figured it out. The class in question has a constructor that takes a parameter. If I remove that then it looks like it is picked up. Is that intentional?
briefcase
 
Posts: 5
Joined: Sun Jul 26, 2009 7:45 pm

Re: Choose Panel not finding all packages

Postby Eric Clayberg » Mon Jul 27, 2009 6:12 am

Yes. Custom Swing widgets need to have a default constructor. See the FAQ...

http://download.instantiations.com/D2WB ... tomWidgets
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

Re: Choose Panel not finding all packages

Postby briefcase » Mon Jul 27, 2009 6:16 am

I somehow missed that in all of my hunting and pecking through your documentation, but it's pretty clear. Thank you.
briefcase
 
Posts: 5
Joined: Sun Jul 26, 2009 7:45 pm

Re: Choose Panel not finding all packages

Postby Eric Clayberg » Mon Jul 27, 2009 6:32 am

I hope it now works for you.
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

Re: Choose Panel not finding all packages

Postby briefcase » Mon Jul 27, 2009 8:07 am

It does. Thanks again.
briefcase
 
Posts: 5
Joined: Sun Jul 26, 2009 7:45 pm

Re: Choose Panel not finding all packages

Postby Eric Clayberg » Tue Jul 28, 2009 6:49 am

Good.
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