Reputation: 154
I need a global refresh function for all the instances of JFrame in a program, which can be called on any instance of JFrame. I however I need different implementations for different instances. What is the correct way to override JFrame to add my abstract method? if that is indeed the correct way to go about this.
Upvotes: 0
Views: 584
Reputation: 1903
public abstract class MyJFrame extends JFrame {
public abstract void refresh();
}
public class MyJFrameA extends MyJFrame {
public void refresh() {
...
}
}
It is one of the possible ways.
Upvotes: 2