I have a general question: Is it possible to create a class, which is an original copy of another class, but contains additional variables?
For example I know that this is possible with a JPanel:
public class CustomPanel extends JPanel{
int exampleVariable = 0;
}
This is possible without any problems. But can I do this with other classes too? In my case I want to do this with Image - but that doesn't seem to be possible, when I add extends Image I have to implement required methods, and that means I have to program a new Image class. Is it possible in another way?
Edit: My aim was to add a method to set the images name...