🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
2 messages
2 total messages Started by Jan Sundin Tue, 06 Apr 2004 10:15
NullPointerException in GUI builder when class hierarchy contains an abstract class
#1115
Author: Jan Sundin
Date: Tue, 06 Apr 2004 10:15
31 lines
2669 bytes
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
Re: NullPointerException in GUI builder when class hierarchy contains an abstract class
#1116
Author: Kevin Dean
Date: Tue, 06 Apr 2004 14:25
70 lines
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
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads