Custom Swing Widgets not displaying

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

Custom Swing Widgets not displaying

Postby sevensoft » Thu Jul 22, 2004 9:23 am

I don't see anything about this on the forums so hopefully this isn't a duplicate post.

We are trying to edit an existing swing applet. It was created in netbeans.
It will not render any of the custom widgets.

We tried to make it simple and just create a new applet and put a single
custom widget on the screen.We created a new JApplet, and put a panel on it, then we tried to add a Bean. This bean is nothing more than an extended JButton that is super simple. It sees the bean and we can select it from the list but when we try to hover over the applet, it comes back with that circle with a slash thru it (the no BS symbol). We can add plain
old JButtons just fine, but not the custom ones (or any custom widget).

We are running Eclipse 3final with the 2.0.1 pro evaluation swing designer plugin.


The code for the button is nothing more than this:
Code: Select all
package foo.bar.button;

import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.Point;
import java.awt.Font;
import java.awt.Color;
import java.awt.Rectangle;

public class AWSButton extends JButton {

    public AWSButton(){
       super();
    }

    public AWSButton(char hotKey){
       super();
       setMnemonic(hotKey);
    }
}


anxiously awaiting any suggestions. thanks!
-ken
sevensoft
 
Posts: 1
Joined: Thu Jul 22, 2004 9:14 am

Re: Custom Swing Widgets not displaying

Postby Eric Clayberg » Thu Jul 22, 2004 5:53 pm

sevensoft wrote:We tried to make it simple and just create a new applet and put a single custom widget on the screen.We created a new JApplet, and put a panel on it, then we tried to add a Bean. This bean is nothing more than an extended JButton that is super simple. It sees the bean and we can select it from the list but when we try to hover over the applet, it comes back with that circle with a slash thru it (the no BS symbol).

Where is the custom widget defined relative to the project containing the window you want to add it to? Is it...

1) In the same project?

2) In a JAR file referenced by the project?

3) In another project referenced by the project? If so, is the project defined in your workspace or outside of your workspace?
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

Unable to use custom components ( beans or panels )

Postby Eugene Ryzhikov » Mon Aug 02, 2004 11:44 am

The Designer does not allow to drop custom Swing components anymore!
Help!
Eugene Ryzhikov
 

Re: Unable to use custom components ( beans or panels )

Postby Eric Clayberg » Mon Aug 02, 2004 12:16 pm

Eugene Ryzhikov wrote:The Designer does not allow to drop custom Swing components anymore!

Based on our download records, you are using a fairly old build of Designer v2.0.1. I would suggest giving the latest v2.0.1 build a try. If that does not work, send an example to support@swt-designer.com. All of our custom Swing examples work fine, so I would need to see a broken example to help.
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

Problem with custom components

Postby Eugene Ryzhikov » Tue Aug 03, 2004 6:57 am

I left my message after downloading the latest ( Aug 1 dated ) build.

It started working for the new panels after logout/login to my machine, but still does not work for old ones ( created with the previous version of the designer )

Any suggestions?

Thanks..
Eugene Ryzhikov
 

Re: Problem with custom components

Postby Eric Clayberg » Tue Aug 03, 2004 8:11 am

Eugene Ryzhikov wrote:It started working for the new panels after logout/login to my machine, but still does not work for old ones ( created with the previous version of the designer )

This would almost always be due to some sort of classpath issue. Where are the custom widgets/panels defined relative to the class you want to use them in? If you can send a self-contained example to support@swt-designer.com that illustrates the problem, we can probably help. Without an example, the most we can do is guess.
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: Google [Bot] and 1 guest