Article View: borland.public.jbuilder.java.swing
Article #1116Re: NullPointerException in GUI builder when class hierarchy contains an abstract class
From: Kevin Dean
Date: Tue, 06 Apr 2004 14:25
Date: Tue, 06 Apr 2004 14:25
70 lines
3943 bytes
3943 bytes
The reason that you can edit the abstract class in the GUI designer is that JBuilder instantiates the base class and uses it in the designer (given that the class you're designing may not compile, JBuilder can't instantiate it but can manage the components). However, when you create a class derived from your abstract class, JBuilder tries to instantiate the base class but can't because it is declared as abstract. The alternative is to create a proxy class that can be instantiated in place of your abstract base class. For details, open index.html in the JBuilder installation directory, go to the JBuilderX release notes, and search for the word "proxy". -- Check out our latest white papers at http://www.datadevelopment.com/papers/index.html BladeNET Scores With Borland Enterprise Tools Team Development with JBuilder and Borland Enterprise Server Dolphin Data Development Ltd. http://www.datadevelopment.com/ "Jan Sundin" <jan@sundin.com> wrote in message news:40727548$1@newsgroups.borland.com... > > Hi > I'm trying to migrate code from an existing user interface to JBuilder X. I have encountered a problem that I have tracked down to the following: > My class hierarchy typically has an abstract super class that extends JInternalFrame. This class adds some behaviour (both visual and nonvisual). Editing this abstract class in the gui builder works fine (impressive, wouldn't have expected that to work). > > Now, the problem is that concrete _subclasses_ to the abstract class are not editable in the gui-builder! When trying to show them in the editor the following message is displayed in the Designer-message panel: > > Failed to create live instance for variable 'this'. null > class java.lang.NullPointerException null > > To "stdout" the following stacktrace is printed: > java.lang.NullPointerException > at com.borland.jbuilder.designer.ui.ModelNode.<init>(Unknown Source) > at com.borland.jbuilder.designer.ui.Model.<init>(Unknown Source) > at com.borland.jbuilder.designer.ui.UIDesigner.annotate(Unknown Source) > at com.borland.jbuilder.designer.DesignerManager.a(Unknown Source) > at com.borland.jbuilder.designer.DesignerViewer.openImpl(Unknown Source) > at com.borland.jbuilder.designer.DesignerViewer.open(Unknown Source) > at com.borland.jbuilder.designer.DesignerViewer.changeUrl(Unknown Source) > at com.borland.jbuilder.designer.DesignerViewer.viewerActivated(Unknown Source) > at com.borland.jbuilder.designer.h.run(Unknown Source) > at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178) > ... > > Making the super-class concrete makes the problem disaapear but that will force me to redesign my existing classhierarcy. Is this a bug? > > I'm using JBuilder (Developer Trial) 10.0.176.0 > > TIA, > > Jan Sundin >
Technical Details
Message-ID:
<4072bdd2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40727548$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,927d5a3b0bc0ff14 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2004-04-06 07:39:21 PST From: "Kevin Dean" <NkOdSePaAnM@datadevelopment.com> Newsgroups: borland.public.jbuilder.java.swing References: <40727548$1@newsgroups.borland.com> Subject: Re: NullPointerException in GUI builder when class hierarchy contains an abstract class Date: Tue, 6 Apr 2004 10:25:18 -0400 Lines: 72 Organization: Dolphin Data Development Ltd. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 24.57.150.243 Message-ID: <4072bdd2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1081261522 24.57.150.243 (6 Apr 2004 07:25:22 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail