D
DBloke
Hi,
I am fairly new to Java and OOP in general and I am using Java 5 at the
moment.
If a method expects a type of ImageFrame, which itself extends Frame
from awt, why will this method not allow me to pass my own JFrame
window, which inherits from Frame, I am using a cast (Frame) myJFrame,
but it keep throwing up an error about Frame not being an ImageFrame.
My understanding was that you could pass a Parent class as an argument
expecting a child of the parent class with a cast operation, I realise
this is not ideal but I do not have the source code to alter the class I
am trying to use, is there another way I can achieve this?
Thanks
DB
I am fairly new to Java and OOP in general and I am using Java 5 at the
moment.
If a method expects a type of ImageFrame, which itself extends Frame
from awt, why will this method not allow me to pass my own JFrame
window, which inherits from Frame, I am using a cast (Frame) myJFrame,
but it keep throwing up an error about Frame not being an ImageFrame.
My understanding was that you could pass a Parent class as an argument
expecting a child of the parent class with a cast operation, I realise
this is not ideal but I do not have the source code to alter the class I
am trying to use, is there another way I can achieve this?
Thanks
DB