T
Thomas Kellerer
Hi,
I'm wondering whether I can create a subclass "on the fly" that implements a
certain interface. E.g. a JPanel that implements an interface, something along
the lines
I know I can write:
JPanel p = new JPanel()
{
public void interfaceMethod()
{
// do some stuff here...
}
};
but how do I declare this new class to implement a certain interface (the one
that is implemented with the anonymous inheritance)?
something like:
JPanel p = new JPanel()
implements MyInterface
{
public void interfaceMethod()
{
}
};
Regards
Thomas
I'm wondering whether I can create a subclass "on the fly" that implements a
certain interface. E.g. a JPanel that implements an interface, something along
the lines
I know I can write:
JPanel p = new JPanel()
{
public void interfaceMethod()
{
// do some stuff here...
}
};
but how do I declare this new class to implement a certain interface (the one
that is implemented with the anonymous inheritance)?
something like:
JPanel p = new JPanel()
implements MyInterface
{
public void interfaceMethod()
{
}
};
Regards
Thomas