BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Suggestions for designing an subclass of an abstract class.

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE
View previous topic :: View next topic  
Author Message
Brian Ray
Guest





PostPosted: Tue Mar 01, 2005 9:39 pm    Post subject: Suggestions for designing an subclass of an abstract class. Reply with quote



We have an application that is an MDI (Multiple Document Interface), and we
need to periodically create new child documents. Our child document
abstract class is called KNetFrame, it subclasses JInternalFrame. It has
some features on it (like buttons), and we want the programmer to implement
the methods required for the buttons to work. For this reason, we have made
the class abstract. But when the programmer wants to design his new
document, the designer says that it can't instantiate the abstract class (of
course not), so it jsut makes a red screen. Does anyone have any ideas on
how we can get around this?

Thanks!


Back to top
Tony
Guest





PostPosted: Tue Mar 01, 2005 9:45 pm    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote



Brian,

An excellent summary of the solution can be found at:

http://www.visi.com/~gyles19/fom-serve/cache/97.html

Cheers,
Tony.



"Brian Ray" <bray (AT) kable (DOT) com> wrote

Quote:
We have an application that is an MDI (Multiple Document Interface), and
we
need to periodically create new child documents. Our child document
abstract class is called KNetFrame, it subclasses JInternalFrame. It has
some features on it (like buttons), and we want the programmer to
implement
the methods required for the buttons to work. For this reason, we have
made
the class abstract. But when the programmer wants to design his new
document, the designer says that it can't instantiate the abstract class
(of
course not), so it jsut makes a red screen. Does anyone have any ideas on
how we can get around this?

Thanks!





Back to top
Kevin Dean [TeamB]
Guest





PostPosted: Tue Mar 01, 2005 9:48 pm    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote



Brian Ray wrote:

Quote:
We have an application that is an MDI (Multiple Document Interface),
and we need to periodically create new child documents. Our child
document abstract class is called KNetFrame, it subclasses
JInternalFrame. It has some features on it (like buttons), and we
want the programmer to implement the methods required for the buttons
to work. For this reason, we have made the class abstract. But when
the programmer wants to design his new document, the designer says
that it can't instantiate the abstract class (of course not), so it
jsut makes a red screen. Does anyone have any ideas on how we can
get around this?

The problem is that the designer needs to instantiate an instance of
the base class in order for you to design an extended class. If you
look at the release notes (setup/release_notes.html) and search for the
word "proxy", you will find details on how to work around this problem.

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html

Back to top
Vladislav Protasov
Guest





PostPosted: Wed Mar 02, 2005 9:32 pm    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote

Hello Brian,

What version of JBuilder are you using?

JBuilder 2005 has unique designer feature, it could design abstract classes.

i.e.
import javax.swing.*;

public abstract class MyPanel extends JPanel {
JButton jButton1 = new JButton();
public MyPanel() {
super();
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}

public abstract void a();

private void jbInit() throws Exception {
jButton1.setText("jButton1");
this.add(jButton1);
}
}

Best regards,
Vladislav

"Brian Ray" <bray (AT) kable (DOT) com> wrote

Quote:
We have an application that is an MDI (Multiple Document Interface), and
we
need to periodically create new child documents. Our child document
abstract class is called KNetFrame, it subclasses JInternalFrame. It has
some features on it (like buttons), and we want the programmer to
implement
the methods required for the buttons to work. For this reason, we have
made
the class abstract. But when the programmer wants to design his new
document, the designer says that it can't instantiate the abstract class
(of
course not), so it jsut makes a red screen. Does anyone have any ideas on
how we can get around this?

Thanks!





Back to top
Vladislav Protasov
Guest





PostPosted: Wed Mar 02, 2005 9:34 pm    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote

Hi Kevin,

Please see my reply

Best regards,
Vladislav

"Kevin Dean [TeamB]" <NkOdSePaAnM (AT) datadevelopment (DOT) com> wrote

Quote:
Brian Ray wrote:

We have an application that is an MDI (Multiple Document Interface),
and we need to periodically create new child documents. Our child
document abstract class is called KNetFrame, it subclasses
JInternalFrame. It has some features on it (like buttons), and we
want the programmer to implement the methods required for the buttons
to work. For this reason, we have made the class abstract. But when
the programmer wants to design his new document, the designer says
that it can't instantiate the abstract class (of course not), so it
jsut makes a red screen. Does anyone have any ideas on how we can
get around this?

The problem is that the designer needs to instantiate an instance of
the base class in order for you to design an extended class. If you
look at the release notes (setup/release_notes.html) and search for the
word "proxy", you will find details on how to work around this problem.

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html



Back to top
Gillmer J. Derge [TeamB]
Guest





PostPosted: Wed Mar 02, 2005 9:49 pm    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote

Vladislav Protasov wrote:
Quote:
JBuilder 2005 has unique designer feature, it could design abstract classes.

But in this guy's case it's the base class that's abstract, not the
class being designed.

Quote:
public abstract class MyPanel extends JPanel {

Now try designing this:

public class MyConcretePanel extends MyPanel {
public void a() {}
}

--
Gillmer J. Derge [TeamB]

Back to top
Vladislav Protasov
Guest





PostPosted: Wed Mar 02, 2005 11:23 pm    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote

Works fine for me, do you see any error message?

"Gillmer J. Derge [TeamB]" <spam (AT) gillmerderge (DOT) com> wrote

Quote:
Vladislav Protasov wrote:
JBuilder 2005 has unique designer feature, it could design abstract
classes.

But in this guy's case it's the base class that's abstract, not the class
being designed.

public abstract class MyPanel extends JPanel {

Now try designing this:

public class MyConcretePanel extends MyPanel {
public void a() {}
}

--
Gillmer J. Derge [TeamB]



Back to top
Gillmer J. Derge [TeamB]
Guest





PostPosted: Thu Mar 03, 2005 12:12 am    Post subject: Re: Suggestions for designing an subclass of an abstract cla Reply with quote

Vladislav Protasov wrote:
Quote:
Works fine for me, do you see any error message?

Oops! Actually, no. I hadn't tried it before, because I'm still a
little afraid of the designer in JB2005, but you're right. It does seem
to work. Both the abstract base class and the concrete subclass came up
in the designer without errors.

--
Gillmer J. Derge [TeamB]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.