Problem with Panel Inheritance

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

Problem with Panel Inheritance

Postby Stefan » Fri Dec 30, 2005 3:48 am

Hi,

I have an inherited panel. In the design view of the child panel the attribute is not displayed. Why not?
Below you see the super class and the child class.

Thanks for any help,
Stefan

Code: Select all
public class PanelGui_fieldStandard extends JPanel {

  private JLabel labelAttribute = new JLabel("attribute");

  public JLabel getLabelAttribute() { return labelAttribute; }
  public void setLabelAttribute(JLabel l) { labelAttribute = l; }

  public PanelGui_fieldStandard() {
    super();
    setLayout(null);
    labelAttribute = new JLabel("attribute");
    labelAttribute.setBounds(10, 10, 200, 20);
    add(labelAttribute);
  }
}


public class PanelGui_fieldImpl extends PanelGui_fieldStandard {

  public PanelGui_fieldImpl() {
    super();
  }

}
Stefan
 
Posts: 2
Joined: Fri Dec 30, 2005 3:36 am

Re: Problem with Panel Inheritance

Postby Eric Clayberg » Fri Dec 30, 2005 6:48 am

Stefan wrote:I have an inherited panel. In the design view of the child panel the attribute is not displayed. Why not?

I don't know. I tried your example and it worked fine for me...

Image

What version of Eclipse are you using? What version of Designer? Make sure that you are using the latest.

Does your Eclipse ".log" show any exceptions?

Does either class have a compilation problem in your system?

Does your project /bin directory contain .class files for both classes?

Have you tried refreshing and building your project?
Last edited by Eric Clayberg on Fri Dec 30, 2005 2:58 pm, edited 1 time in total.
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: Problem with Panel Inheritance

Postby Helloworld » Fri Dec 30, 2005 2:07 pm

Hi Stefan,

I seem this happen ones before. I just exit Eclipse and start again (kinda like reboot M$ windows) and the "VIEW" would work fine again. You must worked too hard :D


Stefan wrote:Hi,

I have an inherited panel. In the design view of the child panel the attribute is not displayed. Why not?
Below you see the super class and the child class.

Thanks for any help,
Stefan

Code: Select all
public class PanelGui_fieldStandard extends JPanel {

  private JLabel labelAttribute = new JLabel("attribute");

  public JLabel getLabelAttribute() { return labelAttribute; }
  public void setLabelAttribute(JLabel l) { labelAttribute = l; }

  public PanelGui_fieldStandard() {
    super();
    setLayout(null);
    labelAttribute = new JLabel("attribute");
    labelAttribute.setBounds(10, 10, 200, 20);
    add(labelAttribute);
  }
}


public class PanelGui_fieldImpl extends PanelGui_fieldStandard {

  public PanelGui_fieldImpl() {
    super();
  }

}
Helloworld
 
Posts: 7
Joined: Fri Dec 16, 2005 1:33 pm

Re: Problem with Panel Inheritance

Postby Eric Clayberg » Fri Dec 30, 2005 3:02 pm

Helloworld wrote:I seem this happen ones before.

In that case, there would have likely been an exception written to your Eclipse log file.

You should check to see whether there is a .class file for your class.

If there is a delay in Eclipse building your project (or you have Build Automatically turned off), there won't be a .class file available, so visual inheritance won't work.
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

Postby Stefan » Tue Jan 03, 2006 3:55 pm

>What version of Eclipse are you using? What version of Designer? Make
>sure that you are using the latest.
Eclipse 3.1.1
Designer 4.2.1

>Does your Eclipse ".log" show any exceptions?
none

>Does either class have a compilation problem in your system?
no

>Does your project /bin directory contain .class files for both classes?
yes

>Have you tried refreshing and building your project?
yes, I also restarted Eclipse

This is what I see:
Image
Stefan
 
Posts: 2
Joined: Fri Dec 30, 2005 3:36 am

Postby Eric Clayberg » Tue Jan 03, 2006 8:22 pm

Stefan wrote:This is what I see

Visual Inheritance is not supported in free mode (note the Pro Mode Only text at the bottom of your screen shot).

You need to be using a fully licensed version of the product or have a current evaluation key.
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