Can anyone tell me if I'm right about the following: a class behaves EXACTLY the same as its parent class if it implements nothing but the constructors with the parameter list as the ones in the parent class?
This is why I'm asking. I've created a JFrame descendant and it causes errors in the application I'm modifying. And all I did was replace "JFrame.class" with "DefaultRootPane.class" on which newInstance() will be called afterwards. I find this very strange!
Here's my class that I think should behave exactly the same as JFrame:
You need to import the classes JFrame and GraphicsConfiguration in your class file. Also add a semi colon after super() in your first constructor
Mark van de Veerdonk
Joined: Dec 08, 2004
Thanx Nigel. I'm using Eclipse so I can see instantly what errors remain. Why the semi-colon was there at the time I posted, I can't remember but I'm pretty sure I tried my software using a working version of the class. The import is also present. I've simply left out what I thought would make my post even more lengthy.
Originally posted by Mark van de Veerdonk: it causes errors in the application I'm modifying.
The more specific information you provide, the better the chances of us helping you. Can you explain exactly what kinds of errors happen? Do you get an exception? Give us the stack trace. Does it work mostly but you see oddities in the UI? Describe the oddities. Etc.
subject: How to make a descendant class that does nothing extra